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.
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.
The marionette.log.level value is case insensitive and this commit
points that out in the documentation associated with the preference.
MozReview-Commit-ID: KZGFE9feFRl
--HG--
extra : rebase_source : 26dad92ff74f8752785061a59df891668c9a0310
marionette.contentListener is being used for silly purposes in
Marionette to tell us when it is "safe" to reuse a content frame.
It will be removed with https://bugzil.la/marionette-window-tracking
but we should nonetheless keep track of which preferences are used.
MozReview-Commit-ID: 5gMCMuYfLBa
--HG--
extra : rebase_source : 884b9e546dd8dd8786fb9b6a984642ff3cb3dcc2
marionette.contentListener is being used for silly purposes in
Marionette to tell us when it is "safe" to reuse a content frame.
It will be removed with https://bugzil.la/marionette-window-tracking
but we should nonetheless keep track of which preferences are used.
MozReview-Commit-ID: 5gMCMuYfLBa
--HG--
extra : rebase_source : 884b9e546dd8dd8786fb9b6a984642ff3cb3dcc2
The documentation for the marionette.enabled preference is wrong: it
claims that it is used for disabling the Marionette XPCOM component,
but in reality it starts and stops the TCP server.
MozReview-Commit-ID: 8oQz8HjPnii
--HG--
extra : rebase_source : 7771f02e18457bc5e567553ca921995d95c40bdd
Some time ago it was decided to remove the marionette.enabled
preference due to concerns that XPCOM addons would be able to
flip arbitrary preferences, potentially causing the remote control
protocol to be activiated unintentionally.
Since then XPCOM based addons have been removed from Firefox in
favour of WebExtensions which do not have the capability to modify
preferences. There are no current plans to make WebExtensions able
to change preferences:
https://wiki.mozilla.org/WebExtensions/FAQ#Does_the_WebExtensions_API_provide_access_to_preferences.3F
This patch reintroduces the marionette.enabled preference, which when
flipped to true will enable Marionette and spin up the TCP listener.
Conversely it will stop the TCP listener and disable the component
when switched back to false.
The primary motivation for reintroducing it is the forthcoming
addition of a new navigator.webdriver WebIDL attribute. The WebIDL
interfaces can be annotated with [Pref="<pref name>"] which will
automatically generate C++ code for determining whether it should be
present in the interface. This is the easiest and least obstrusive
way for Marionette to cause the webdriver attribute to appear on
the navigator global.
MozReview-Commit-ID: 28wN8Z3Q2a6
--HG--
extra : rebase_source : 6390b470bb7793a0c38cacc77e557000b497a290
This includes the marionette.debugging.clicktostart preference
we use when --jsdebugger is passed to "./mach marionette test"
or geckodriver in the Marionette preference listing. This will
expose it in about:config.
MozReview-Commit-ID: 4iIcSR4LB7M
--HG--
extra : rebase_source : 696accf67e448855da35ed094d879a81fd3efacd
In particular, XPCNativeWrapper should probably be made available
by default.
MozReview-Commit-ID: E1oYFyApbLi
--HG--
extra : rebase_source : 4e27ad6882bd4e43dadc97d4fd2a186e01510dfd
Windows systems only accept singled-dashed -marionette, whereas Unix
platforms accept both that and double-dashed --marionette. This makes
the documentation true for all supported platforms.
MozReview-Commit-ID: IG7ir2HVoHo
--HG--
extra : rebase_source : f3b2740e47f373e5f784d131f1844f82b4c56990
There are no current use cases for starting and stopping the Marionette
server at runtime through a preference. Since it is possible for
arbitrary addons to modify any preference, we are removing it to reduce
the potential attack surface for Marionette.
This effectively leaves only three ways of starting Marionette:
By passing the -marionette flag to the Firefox binary at startup,
setting the MOZ_MARIONETTE environment variable, and by calling
server.TCPListener#start(), which is an internal chrome API.
MozReview-Commit-ID: 9zKsV8ufySU
--HG--
extra : rebase_source : c0914f2ab99229d507830bbf9704e82bd83b1883
marionette.forcelocal was historically used to connect free-standing B2G
devices over real networks, such as wi-fi, to Marionette. Since we do
not have this use case anymore and Android uses adb and port forwarding,
this removes the marionette.forcelocal preference to reduce the attack
surface for Marionette.
MozReview-Commit-ID: KgqUrilpwMM
--HG--
extra : rebase_source : 43cbb0e3928f3c2a383d66ec30873953a45beda5
The Marionette component ships in Firefox, but is not enabled by default.
We want to facilitate activating Marionette at runtime by flipping
the marionette.enabled preference, and showing the Marionette related
preferences in about:config helps discoverability.
It is also useful to rely on the preferences' default values so that
they do not have to be hardcoded in the component.
When Marionette is enabled by setting marionette.enabled to true, a set of
recommended automation preferences found in testing/marionette/server.js
are set if the user has not overriden/user-defined one of them and
marionette.prefs.recommended is true (default). When Marionette is
stopped, the altered preferences are reset.
MozReview-Commit-ID: 3HLnEI0TEBB
--HG--
extra : rebase_source : 8be91ed46c443dd120cbc4b42c729cf3ae250b5f
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
The Marionette component ships in Firefox, but is not enabled by default.
We want to facilitate activating Marionette at runtime by flipping
the marionette.enabled preference, and showing the Marionette related
preferences in about:config helps discoverability.
It is also useful to rely on the preferences' default values so that
they do not have to be hardcoded in the component.
When Marionette is enabled by setting marionette.enabled to true, a set of
recommended automation preferences found in testing/marionette/server.js
are set if the user has not overriden/user-defined one of them and
marionette.prefs.recommended is true (default). When Marionette is
stopped, the altered preferences are reset.
MozReview-Commit-ID: 3HLnEI0TEBB
--HG--
extra : rebase_source : 6557962c8dbd91002bbf22690ef03cd4cbcbbe38
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
The Marionette component ships in Firefox, but is not enabled by default.
We want to facilitate activating Marionette at runtime by flipping
the marionette.enabled preference, and showing the Marionette related
preferences in about:config helps discoverability.
It is also useful to rely on the preferences' default values so that
they do not have to be hardcoded in the component.
When Marionette is enabled by setting marionette.enabled to true, a set of
recommended automation preferences found in testing/marionette/server.js
are set if the user has not overriden/user-defined one of them and
marionette.prefs.recommended is true (default). When Marionette is
stopped, the altered preferences are reset.
MozReview-Commit-ID: 3HLnEI0TEBB
--HG--
extra : rebase_source : 00b22e2b63cf2f5183c49bdc84bcc172b8a4c3a1
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
The Marionette component ships in Firefox, but is not enabled by default.
We want to facilitate activating Marionette at runtime by flipping
the marionette.enabled preference, and showing the Marionette related
preferences in about:config helps discoverability.
It is also useful to rely on the preferences' default values so that
they do not have to be hardcoded in the component.
When Marionette is enabled by setting marionette.enabled to true, a set of
recommended automation preferences found in testing/marionette/server.js
are set if the user has not overriden/user-defined one of them and
marionette.prefs.recommended is true (default). When Marionette is
stopped, the altered preferences are reset.
MozReview-Commit-ID: 3HLnEI0TEBB
--HG--
extra : rebase_source : 56e99bb5d075b54dedc2a957e0f46a209a1e48a8
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