***
Bug 1514594: Part 3a - Change ChromeUtils.import to return an exports object; not pollute global. r=mccr8
This changes the behavior of ChromeUtils.import() to return an exports object,
rather than a module global, in all cases except when `null` is passed as a
second argument, and changes the default behavior not to pollute the global
scope with the module's exports. Thus, the following code written for the old
model:
ChromeUtils.import("resource://gre/modules/Services.jsm");
is approximately the same as the following, in the new model:
var {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
Since the two behaviors are mutually incompatible, this patch will land with a
scripted rewrite to update all existing callers to use the new model rather
than the old.
***
Bug 1514594: Part 3b - Mass rewrite all JS code to use the new ChromeUtils.import API. rs=Gijs
This was done using the followng script:
https://bitbucket.org/kmaglione/m-c-rewrites/src/tip/processors/cu-import-exports.jsm
***
Bug 1514594: Part 3c - Update ESLint plugin for ChromeUtils.import API changes. r=Standard8
Differential Revision: https://phabricator.services.mozilla.com/D16747
***
Bug 1514594: Part 3d - Remove/fix hundreds of duplicate imports from sync tests. r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D16748
***
Bug 1514594: Part 3e - Remove no-op ChromeUtils.import() calls. r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D16749
***
Bug 1514594: Part 3f.1 - Cleanup various test corner cases after mass rewrite. r=Gijs
***
Bug 1514594: Part 3f.2 - Cleanup various non-test corner cases after mass rewrite. r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D16750
--HG--
extra : rebase_source : 359574ee3064c90f33bf36c2ebe3159a24cc8895
extra : histedit_source : b93c8f42808b1599f9122d7842d2c0b3e656a594%2C64a3a4e3359dc889e2ab2b49461bab9e27fc10a7
This makes it much easier to update existing consumers of
XPCOMUtils.enumerateCategoryEntries to use the category manager directly.
It also, unfortunately, requires updating existing category manager consumers
to use the Services getter in order to avoid ESLint errors.
Differential Revision: https://phabricator.services.mozilla.com/D4278
--HG--
extra : rebase_source : fb9fd9b21db80af472ff6250a2e9a35e8d538147
Removed remaining imports of commandline helpers, as they are no longer used anywhere
Differential Revision: https://phabricator.services.mozilla.com/D3412
--HG--
extra : moz-landing-system : lando
DocShells are associated with outer DOM Windows, rather than Documents, so
having the getter on the document is a bit odd to begin with. But it's also
considerably less convenient, since most of the times when we want a docShell
from JS, we're dealing most directly with a window, and have to detour through
the document to get it.
MozReview-Commit-ID: LUj1H9nG3QL
--HG--
extra : source : fcfb99baa0f0fb60a7c420a712c6ae7c72576871
extra : histedit_source : 5be9b7b29a52a4b8376ee0bdfc5c08b12e3c775a
DocShells are associated with outer DOM Windows, rather than Documents, so
having the getter on the document is a bit odd to begin with. But it's also
considerably less convenient, since most of the times when we want a docShell
from JS, we're dealing most directly with a window, and have to detour through
the document to get it.
MozReview-Commit-ID: LUj1H9nG3QL
--HG--
extra : rebase_source : a13c59d1a5ed000187c7fd8e7339408ad6e2dee6
Services is now used in the reps bundle but can't be loaded in the json-viewer.
Since it's only used in the ObjectInspector, which we don't use in the json-viewer,
we can mock it.
MozReview-Commit-ID: DvAxzXTb67K
--HG--
extra : rebase_source : 59c907824e94825357e5049b83ba60afebeddc9a
This adds buttons to collapse and expand the JSON tree. If the file
is larger than 100kB the "Expand All" button is hidden for performance
reasonds, as well as test cases for the buttons.
This also fixes all the tests to not rely on eval() anymore.
MozReview-Commit-ID: 8H8r497nQVK
--HG--
extra : rebase_source : 89c7f8a6e1bb77ceb242f05749c22d929ee86929
This adds buttons to collapse and expand the JSON tree. If the file
is larger than 100kB the "Expand All" button is hidden for performance
reasonds.
--HG--
extra : histedit_source : 3fa4d8e5523afbc423ebc5a6d803bdb84100f9d7
Also fixes existing code which fails the rule.
MozReview-Commit-ID: CkLFgsspGMU
--HG--
extra : rebase_source : 86a43837659aa2ad83a87eab53b7aa8d39ccf55b
Changes and notes:
- Created `devtools/client/shared/test/telemetry-test-helpers.js`, which
contains test helpers to aid in creating and running telemetry tests.
- Removed any telemetry monkeypatching as it is not dependable and no longer
needed (there is some left in GCLI but the test is now disabled because
we are removing GCLI soon anyhow).
- Because `telemetry-test-helpers.js` is imported by `shared-head.js` I
have had to make it available everywhere that shared-head.js is used.
- All telemetry tests have been rewritten to use the new helper.
- shared-head.js cannot be imported by tests inside
`devtools/client/performance/test/` because perf have custom `once` and
`waitFor` implementations that act differently from the ones inside
`shared-head.js`. This means I had to import the telemetry helpers into
`devtools/client/performance/test/head.js`
- Created `devtools/client/shared/test/browser_telemetry_misc.js` to be sure
to catch `DEVTOOLS_SCREEN_RESOLUTION_ENUMERATED_PER_USER` (we catch a few
others to be thorough).
- Disabled `browser_inspector_menu-02-copy-items.js`, which was failing to
test some expired scalars. I also corrected the way the scalars are logged
because it was completely wrong.
MozReview-Commit-ID: JjQEGM6hT61
--HG--
extra : rebase_source : cd1214d01bd11908f69167839975cd93ecb83421
These issues were previously ignored due to the nature of our global import
rules. They need to be fixed before that rule can be updated.
MozReview-Commit-ID: DCChktTc5TW
--HG--
extra : rebase_source : cffb1c9762191c579d1397c8169e6e7635d229da
extra : histedit_source : dea59ddd2daaae52069c5faceae9149a4f08dd73
We don't populate the href attribute on links anymore and reps require
that we pass an openLink function to handle them.
This had an impact on the test where we are testing those links.
MozReview-Commit-ID: Hj2PBX79HZu
--HG--
extra : rebase_source : 1602504731c5a3be4379f9f6631aaf492c7d6daf
browser_google_behavior.js is the only remaining exception.
MozReview-Commit-ID: GA15P7f0KBv
--HG--
extra : rebase_source : 7cb70cb6108abc6746a9261922bd2826bb11a9b7
Move frame-script-utils.js into shared/test since it is a test only file. In
addition, it's removed from jar.mn so it won't be part the file we ship. Test
manifests can use the absolute path syntax to make it accessible in new
directories.
MozReview-Commit-ID: 5sKYvv2rsJs
--HG--
rename : devtools/client/shared/frame-script-utils.js => devtools/client/shared/test/frame-script-utils.js
extra : rebase_source : 8c4d77c37cacdae36d17102b4dbf1222ec1fbd8a
Use `loadFrameScriptUtils` from shared-head as a central utility for loading the
frame script utils helper. This means less stray references to the utils file's
path across our tests.
As part of this, I went ahead and converted Canvas Debugger, Shader Editor, and
Web Audio Editor to shared-head, as that seemed like the best path to reduce
duplication.
(I left one extra path reference in profiler-mm-utils.js as-is, since it's a
module, so shared-head is not easily usable there.)
MozReview-Commit-ID: AKbZt8Jo0GM
--HG--
extra : rebase_source : e70b29153ef8d96d7026bc3abd0fb0d2306849bc
Move frame-script-utils.js into shared/test since it is a test only file. In
addition, it's removed from jar.mn so it won't be part the file we ship. Test
manifests can use the absolute path syntax to make it accessible in new
directories.
MozReview-Commit-ID: 5sKYvv2rsJs
--HG--
rename : devtools/client/shared/frame-script-utils.js => devtools/client/shared/test/frame-script-utils.js
extra : rebase_source : cb18b88016df8bc7fba1620534beed473ebb406a
Use `loadFrameScriptUtils` from shared-head as a central utility for loading the
frame script utils helper. This means less stray references to the utils file's
path across our tests.
As part of this, I went ahead and converted Canvas Debugger, Shader Editor, and
Web Audio Editor to shared-head, as that seemed like the best path to reduce
duplication.
(I left one extra path reference in profiler-mm-utils.js as-is, since it's a
module, so shared-head is not easily usable there.)
MozReview-Commit-ID: AKbZt8Jo0GM
--HG--
extra : rebase_source : d00f578d7c9078088be8c33ad80eb30a59d6a6e8