Commit Graph

19 Commits

Author SHA1 Message Date
Kris Maglione
e930b89c34 Bug 1514594: Part 3 - Change ChromeUtils.import API.
***
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
2019-01-17 10:18:31 -08:00
Andreas Tolfsen
719b4c5e30 Bug 1482829 - Track Marionette logger verbosity with Log#manageLevelFromPref. r=whimboo
This patch adopts Logger#managerLevelFromPref from Log.jsm to set
and keep track of the Marionette logger's verbosity.

This has the advantage that we do not have to roll separate
implementations of Log for the child- and parent processes.  It also
has the upside that the log level will be reflected when changed
at runtime through the use of an observer.
2018-08-17 12:55:33 +01:00
Andreas Tolfsen
9c611e01aa Bug 1480810 - Drop PREF_COMPLEX from Marionette prefs module. r=automatedtester
A warning appears in the console when you run xpcshell tests that
the PREF_COMPLEX type is no longer, and we should therefore remove
it from Marionette as well.
2018-08-05 14:19:01 +01:00
Andreas Tolfsen
394ba9bb0b Bug 1476305 - Add pref to not truncate Marionette log messages. r=automatedtester
Marionette currently truncates a selection of log messages that
exceed 250 characters.  It is however sometimes, usually when
debugging locally, to not truncate logs so one can see exactly what
is sent to and fro the server.
2018-07-24 13:33:51 +01:00
Andreas Tolfsen
583e0a9e7d Bug 1464469 - Shorthands for setting up Marionette logger. r=whimboo
This patch generalises logger setup and access by providing
one interface with specialised implementations for the main-
and child processes.  This will mean we can get rid of ad-hoc
logger setup in testing/marionette/components/marionette.js and
testing/marionette/listener.js.

In the case for the component file, the log level and the stdout
dump appender is set up when you request the logger.  The same is
true when requesting the logger in a child process, but it will
additionally request the log level from the main process.

Usage:

    const {Log} = ChromeUtils.import("chrome://marionette/content/log.js", {});
    let log = Log.get();

MozReview-Commit-ID: 8Ha5FSaoGXp

--HG--
extra : rebase_source : 0ad13e805cd1c6a4a8332fdbe6124a82719c4656
2018-06-06 14:32:18 +01:00
Andreas Tolfsen
4e7776764d Bug 1456050 - Add marionette.contentListener to MarionettePrefs. r=whimboo
MozReview-Commit-ID: 1SPrw4Vwd3N

--HG--
extra : rebase_source : f2218a9ec0ebc3472a964abcca0bd1aa09ed2eb0
2018-04-23 07:26:09 +01:00
Andreas Tolfsen
d964f30a08 Bug 1456050 - Add marionette.debugging.clicktostart to MarionettePrefs. r=whimboo
MozReview-Commit-ID: BAxcJFcv1uD

--HG--
extra : rebase_source : 7982a7e72b0c878621db896613f53599053c56e7
2018-04-23 07:17:44 +01:00
Andreas Tolfsen
eb2244da5a Bug 1432894 - Provide shorthands for Marionette prefs. r=whimboo
This introduces a new testing/marionette/prefs.js module with shorthands
for all of Marionette's preferences.  Getters are provided for all
preferences, but setters are only offered for preference we expect
to mutate at runtime.

The new module additionally provides a preference abstraction on
top of nsIPrefService instead of Preferences.jsm.  We cannot use
Preferences.jsm during startup in Marionette because Marionette
gets loaded unconditionally.

Finally an EnvironmentPrefs class is provided for reading and iterating
over preferences stored in JSON Objects in environment variables.

MozReview-Commit-ID: FbgdBEkf5A

--HG--
extra : rebase_source : 0d5b2f11dc94a74aff3f742ef191b72b159b5ee7
2018-04-14 17:25:26 +01:00
Brindusan Cristian
681c4cb5d6 Backed out 4 changesets (bug 1432894) for linting opt test-doc-generate failures.
Backed out changeset fb56c3c325d3 (bug 1432894)
Backed out changeset 531f8f2af57d (bug 1432894)
Backed out changeset 8e9f1887bc89 (bug 1432894)
Backed out changeset f37ff744e424 (bug 1432894)
2018-04-22 19:24:09 +03:00
Andreas Tolfsen
7f913180d9 Bug 1432894 - Provide shorthands for Marionette prefs. r=whimboo
This introduces a new testing/marionette/prefs.js module with shorthands
for all of Marionette's preferences.  Getters are provided for all
preferences, but setters are only offered for preference we expect
to mutate at runtime.

The new module additionally provides a preference abstraction on
top of nsIPrefService instead of Preferences.jsm.  We cannot use
Preferences.jsm during startup in Marionette because Marionette
gets loaded unconditionally.

Finally an EnvironmentPrefs class is provided for reading and iterating
over preferences stored in JSON Objects in environment variables.

MozReview-Commit-ID: FbgdBEkf5A

--HG--
extra : rebase_source : c3666ff19f4bf8092d9976bbf5e98cd45438e586
2018-04-14 17:25:26 +01:00
Andreas Tolfsen
eb895f6667 Bug 1350887 - Ensure Marionette prefs file has sensible name; r=maja_zf
Files appended to JS_PREFERENCE_FILES are moved into the
objdir/dist/bin/defaults/pref directory, shared with default global
preferences from other parts of Gecko.

To ensure Marionette's preference file ends up in this directory with
a sensible name, we put it in testing/marionette/prefs/marionette.js so
that it ends up in the objdir as dist/bin/defaults/pref/marionette.js.

MozReview-Commit-ID: 9YJ7vysDjSJ

--HG--
rename : testing/marionette/prefs.js => testing/marionette/prefs/marionette.js
extra : rebase_source : a5f275ed051eac659e89b55e8dfe950b67885618
2017-03-30 14:52:16 +01:00
Sebastian Hengst
05dc53ce54 Backed out changeset 5146b0e10a73 (bug 1350887) for failing 541406-1.html with assertion aEditor at IMEContentObserver.cpp:285. r=backout
--HG--
rename : testing/marionette/prefs/marionette.js => testing/marionette/prefs.js
2017-04-04 15:59:20 +02:00
Andreas Tolfsen
90caadb8dd Bug 1350887 - Ensure Marionette prefs file has sensible name; r=maja_zf
Files appended to JS_PREFERENCE_FILES are moved into the
objdir/dist/bin/defaults/pref directory, shared with default global
preferences from other parts of Gecko.

To ensure Marionette's preference file ends up in this directory with
a sensible name, we put it in testing/marionette/prefs/marionette.js so
that it ends up in the objdir as dist/bin/defaults/pref/marionette.js.

MozReview-Commit-ID: 9YJ7vysDjSJ

--HG--
rename : testing/marionette/prefs.js => testing/marionette/prefs/marionette.js
extra : rebase_source : 54e084700d1ae691a0395531156626f56190f0fe
2017-03-30 14:52:16 +01:00
Wes Kocher
d11e3dc66d Backed out 7 changesets (bug 1350887) for build bustage on a CLOSED TREE
Backed out changeset d2b395e6c5c0 (bug 1350887)
Backed out changeset 5a6d5c43135f (bug 1350887)
Backed out changeset ec57676ad0d1 (bug 1350887)
Backed out changeset 4a3d1a8767f7 (bug 1350887)
Backed out changeset 40cd9ca1553e (bug 1350887)
Backed out changeset d264991a436d (bug 1350887)
Backed out changeset b915d40a6ba6 (bug 1350887)

--HG--
rename : testing/marionette/prefs/marionette.js => testing/marionette/prefs.js
2017-04-03 13:30:35 -07:00
Andreas Tolfsen
f2e39ffedb Bug 1350887 - Ensure Marionette prefs file has sensible name; r=maja_zf
Files appended to JS_PREFERENCE_FILES are moved into the
objdir/dist/bin/defaults/pref directory, shared with default global
preferences from other parts of Gecko.

To ensure Marionette's preference file ends up in this directory with
a sensible name, we put it in testing/marionette/prefs/marionette.js so
that it ends up in the objdir as dist/bin/defaults/pref/marionette.js.

MozReview-Commit-ID: 9YJ7vysDjSJ

--HG--
rename : testing/marionette/prefs.js => testing/marionette/prefs/marionette.js
extra : rebase_source : d5bf0abf80d20086945d51e05f3e5115880fdc20
2017-03-30 14:52:16 +01:00
Sebastian Hengst
58d0365b43 Backed out changeset 1438936f7cb6 (bug 1350887) for breaking packaging on OSX. r=backout
--HG--
rename : testing/marionette/prefs/marionette.js => testing/marionette/prefs.js
2017-04-03 21:40:48 +02:00
Andreas Tolfsen
70882edb17 Bug 1350887 - Ensure Marionette prefs file has sensible name; r=maja_zf
Files appended to JS_PREFERENCE_FILES are moved into the
objdir/dist/bin/defaults/pref directory, shared with default global
preferences from other parts of Gecko.

To ensure Marionette's preference file ends up in this directory with
a sensible name, we put it in testing/marionette/prefs/marionette.js so
that it ends up in the objdir as dist/bin/defaults/pref/marionette.js.

MozReview-Commit-ID: 9YJ7vysDjSJ

--HG--
rename : testing/marionette/prefs.js => testing/marionette/prefs/marionette.js
extra : rebase_source : d5bf0abf80d20086945d51e05f3e5115880fdc20
2017-03-30 14:52:16 +01:00
Andreas Tolfsen
3ab0090e16 Bug 1344748 - Gate recommended prefs on a preference; r=maja_zf,whimboo
MozReview-Commit-ID: FnqBDAXpg6v

--HG--
extra : rebase_source : a716ea82000f6d5e5ed4408639cb1628c13a0a1c
2017-03-07 21:02:05 +00:00
Andreas Tolfsen
869b1b932a Bug 1344748 - Rename and register Marionette prefs; r=maja_zf
This change renames the following Marionette preferences:

    	marionette.defaultPrefs.enabled	marionette.enabled
    	marionette.defaultPrefs.port	marionette.port
    	marionette.force-local		marionette.forcelocal
    	marionette.logging		marionette.log.level

The old preference names are still usable, but are henceforth considered
deprecated.  They will be removed when Firefox 55 ships.

It also registers these preferences in Firefox so that they are
discoverable through about:config.

This patch also refactors testing/marionette/components/marionette.js.

MozReview-Commit-ID: 1dAMQS2e0og

--HG--
extra : rebase_source : e59a9e656442d8e8cebeaf5e741dc8306436bc22
2017-03-09 11:12:53 +00:00