Provide the equivalent of ChromeUtils.import via SpecialPowers
Categories
(Testing :: Mochitest, task)
Tracking
(firefox102 fixed)
Tracking | Status | |
---|---|---|
firefox102 | --- | fixed |
People
(Reporter: arai, Assigned: arai)
References
Details
Attachments
(12 files)
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review |
Currently SpecialPowers
provides JSM import feature by SpecialPowers.Cu.import
, but it has difference between ChromeUtils.import
.
ChromeUtils.import
returns exports object, but SpecialPowers.Cu.import
returns global object.
The former supports lexical variables, but the latter doesn't have them, so
the latter requires variables defined on the JSM's global this
property.
To my understanding, this is part of the reason why we have this.Foo = Foo
in JSM code.
We can temporarily provide SpecialPowers.ChromeUtils_import
or something that performs ChromeUtils.import
, and replace SpecialPowers.Cu.import
with it,
and then remove this.Foo = Foo
in JSM code.
Assignee | ||
Comment 1•2 years ago
|
||
bug 1765167 needs SpecialPowers.ChromeUtils_import
, to replace the Cu.import
usage in EventUtils.js
https://searchfox.org/mozilla-central/rev/4b3039b48c3cb67774270ebcc2a7d8624d888092/testing/mochitest/tests/SimpleTest/EventUtils.js#61
Comment 2•2 years ago
|
||
This should probably be in Testing::Mochitest or something along those lines, rather than Firefox::General.
Assignee | ||
Updated•2 years ago
|
Assignee | ||
Comment 3•2 years ago
|
||
Given bug 1758481, it would make sense to drop the 2nd parameter from SpecialPowers.ChromeUtils_import
implementation,
to avoid adding more consumer of the 2nd parameter.
Assignee | ||
Comment 4•2 years ago
|
||
Depends on D144081
Assignee | ||
Comment 5•2 years ago
|
||
Depends on D144082
Assignee | ||
Comment 6•2 years ago
|
||
Depends on D144083
Assignee | ||
Comment 7•2 years ago
|
||
Depends on D144084
Assignee | ||
Comment 8•2 years ago
|
||
Depends on D144085
Assignee | ||
Comment 9•2 years ago
|
||
Depends on D144086
Assignee | ||
Comment 10•2 years ago
|
||
Depends on D144087
Assignee | ||
Comment 11•2 years ago
|
||
Depends on D144088
Assignee | ||
Comment 12•2 years ago
|
||
Depends on D144089
Assignee | ||
Comment 13•2 years ago
|
||
Depends on D144090
Assignee | ||
Comment 14•2 years ago
|
||
Depends on D144091
Assignee | ||
Comment 15•2 years ago
|
||
Depends on D144092
Assignee | ||
Comment 16•2 years ago
|
||
:mccr8, can I have your opinion about the API design here?
The current WIP patches above adds SpecialPowers.ChromeUtils_import
function with single parameter.
The other possibility are:
- Expose the entire
ChromeUtils
asSpecialPowers.ChromeUtils
, and let the consumer callSpecialPowers.ChromeUtils.import
- Expose
ChromeUtils.import
asSpecialPowers.import
or something with shorter name
Comment 17•2 years ago
|
||
Kris is probably a better person to ask about this.
Comment 18•2 years ago
|
||
I would lean towards just exposing SpecialPowers.ChromeUtils
, but I would also be OK with SpecialPowers.import
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Assignee | ||
Comment 19•2 years ago
|
||
Note for testing
Some pre-existing test-verify failures are expected with this patch stack.
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Comment 20•2 years ago
|
||
Pushed by arai_a@mac.com: https://hg.mozilla.org/integration/autoland/rev/c754789316ab Part 1: Add SpecialPowers.ChromeUtils. r=kmag https://hg.mozilla.org/integration/autoland/rev/1c2a9d039e65 Part 2: Use SpecialPowers.ChromeUtils.import in browser/. r=kmag https://hg.mozilla.org/integration/autoland/rev/ca2494740fc0 Part 3: Use SpecialPowers.ChromeUtils.import in dom/. r=kmag https://hg.mozilla.org/integration/autoland/rev/534748aa61db Part 4: Use SpecialPowers.ChromeUtils.import in editor/. r=kmag https://hg.mozilla.org/integration/autoland/rev/dd7eb05d40c9 Part 5: Use SpecialPowers.ChromeUtils.import in extensions/. r=kmag https://hg.mozilla.org/integration/autoland/rev/ff0e0d60d30c Part 6: Use SpecialPowers.ChromeUtils.import in js/xpconnect/. r=kmag https://hg.mozilla.org/integration/autoland/rev/bb3c4b716945 Part 7: Use SpecialPowers.ChromeUtils.import in layout/. r=kmag https://hg.mozilla.org/integration/autoland/rev/a06b5b3f366d Part 8: Use SpecialPowers.ChromeUtils.import in mobile/. r=geckoview-reviewers,agi https://hg.mozilla.org/integration/autoland/rev/6c4e9b18e436 Part 9: Use SpecialPowers.ChromeUtils.import in testing/. r=kmag https://hg.mozilla.org/integration/autoland/rev/4f77ac47c966 Part 10: Use SpecialPowers.ChromeUtils.import in toolkit/components/extensions/. r=kmag https://hg.mozilla.org/integration/autoland/rev/c1cc78ae7763 Part 11: Use SpecialPowers.ChromeUtils.import in toolkit/components/passwordmgr/. r=kmag https://hg.mozilla.org/integration/autoland/rev/29adb3089e10 Part 12: Use SpecialPowers.ChromeUtils.import in toolkit/. r=kmag
Comment 21•2 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/c754789316ab
https://hg.mozilla.org/mozilla-central/rev/1c2a9d039e65
https://hg.mozilla.org/mozilla-central/rev/ca2494740fc0
https://hg.mozilla.org/mozilla-central/rev/534748aa61db
https://hg.mozilla.org/mozilla-central/rev/dd7eb05d40c9
https://hg.mozilla.org/mozilla-central/rev/ff0e0d60d30c
https://hg.mozilla.org/mozilla-central/rev/bb3c4b716945
https://hg.mozilla.org/mozilla-central/rev/a06b5b3f366d
https://hg.mozilla.org/mozilla-central/rev/6c4e9b18e436
https://hg.mozilla.org/mozilla-central/rev/4f77ac47c966
https://hg.mozilla.org/mozilla-central/rev/c1cc78ae7763
https://hg.mozilla.org/mozilla-central/rev/29adb3089e10
Description
•