Various fixes to make the generated API documentation from
testing/marionette somewhat easier to read.
MozReview-Commit-ID: F9duuQoOYBt
--HG--
extra : rebase_source : 3ade69773ceba42826aedef05b1371240b51cf82
Instead of importing everything from the testing/marionette/error.js
module into the global scope, we need to be selective about what symbols
we want.
MozReview-Commit-ID: HZDAS0bs0GD
--HG--
extra : rebase_source : 14a300bb2cedc0716168d50846755a6faed83012
Remove the forbiddenURI pref which was removed in bug 1274893 as well
as browser.safebrowsing.enabled which got renamed in bug 1025965.
Set dummy URLs for all of the network endpoints.
MozReview-Commit-ID: Efk2fv6cC3g
--HG--
extra : rebase_source : 9fbb3eb0fa7f002fe24577a8a0870ec4d1b7cf31
Adds a new system notification, "remote-active", which fires
when the Marionette remote protocol becomes active.
MozReview-Commit-ID: 3Parr82Ch6I
--HG--
extra : rebase_source : 08e2388a067b1decdd6fb62ebef97798d4227faf
Removes references to now unused pref that was added in bug 868441 and removed in bugs 913807 and 1054572. It also removes some leftovers from http channel which have not been removed in those 2 bugs.
This patch introduces a new environment variable, MOZ_MARIONETTE, which
if set will start the Marionette remote control server. This is meant
to be analogous to passing the -marionette flag to the Firefox binary.
When the server is started, we set the environment variable to
preserve Marionette's enabled state across internal restarts.
When Services.startup.quit(eRestart) is called, Firefox is restarted
without the original command line flags it was started with, which means
we lose track of whether Marionette was enabled. By setting
MOZ_MARIONETTE in-process, we preserve the knowledge of this state.
This approach is in line with how state is preserved across in-app
restarts in toolkit/xre/nsAppRunner.cpp:4761 (XRE_PROFILE_*), and for
how MOZ_APP_RESTART and XUL_APP_FILE works.
MozReview-Commit-ID: Dcb34m6FoZh
--HG--
extra : rebase_source : 98515c702dfd8eaad01f7eab06d33124ce14b15c
Note that the UITour library can still show a panel in the event that we want to
promote the feature that way.
MozReview-Commit-ID: FzKSzO987h7
--HG--
extra : rebase_source : 8c129106478559f011a3a4e311331851939ab408
DevTools is about to move out of mozilla-central and be released as an add-on.
So that these protocol files are going to be missing from the tree.
To accommodate that, we are doing a copy of them next to marionette.
MozReview-Commit-ID: 9PyhuwyZyXI
--HG--
extra : rebase_source : b6d96ae5e4c4ac837713e396ab72163b168871f2
Write the allocated port to the marionette.port preference when binding
the TCP socket server to the requested port.
If the socket is bound to port 0, this instructs the system to atomically
allocate a free port in the ephemeral range. Writing the resolved port
to a preference will make it possible to communicate this port number
to the client, removing any chance of a race condition occurring by the
client looking for a free port (binding and releasing) for the server.
MozReview-Commit-ID: JwyG2G4YQmX
--HG--
extra : rebase_source : 98e38660813c0868f3358183825ad08392e62d37
This patch removes the Marionette server's ability to accept non-loopback
connections completely. The configuration option for this, the
marionette.forcelocal preference, was removed in the previous patch in
this changeset.
MozReview-Commit-ID: 3XXYpTDGs8S
--HG--
extra : rebase_source : a5ffaab36734afe1ca663453b21e5fd6f90ac970
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
This rolls browser.tabs.animate, browser.fullscreen.animate, and
alerts.disableSlidingEffect into a single pref; if any of these are disabled,
we'll disable the new pref too (toolkit.cosmeticAnimations.enabled). Most
future animations will also be subject to this pref.
MozReview-Commit-ID: 77pLMtERDna
--HG--
extra : rebase_source : 8939e453c2277caa4a90123ae09bb542aaa421ed
This preference should have been part of the recommended automation
preferences when the set was first installed. This recitfies the omission
by not causing the browser to redirect the user to an upgrade website
when a milestone upgrade of Firefox is detected.
MozReview-Commit-ID: ACUeJ2vPhl9
--HG--
extra : rebase_source : 1bf5c607142ea4afafa2defb87f2a8bf4f412fe4
When Marionette receives packets it does not know how to deal with,
handle this gracefully and attempt to respond to the client that we were
unable to process them.
If it receives a packet that is corrupt, e.g. one it is impossible to
determine the message ID of, report an error to the console without
failing spectacularly.
If it receives a packet that it is unable to unmarshal, attempt to craft
a response for it with containing the error signature.
MozReview-Commit-ID: BLi8yIkGQfF
--HG--
extra : rebase_source : e7dc763a2345f79712b5e8524bd1d4f81b66699c
Merges testing/marionette/dispatcher.js into testing/marionette/server.js
and renames it server.TCPConnection.
The rationale behind this change is that the current dispatcher is not
a single entity to which incoming requests are dispatched. The old
organisation might make sense if this was an HTTP server where all
connections are transitive and it didn't hold any connection details,
however the dispatcher is in effect a representation of a client socket
connection.
Since the module is not used elsewhere, it makes sense to pair it with
the existing server.TCPListener class.
MozReview-Commit-ID: 2HF35OiP6AY
--HG--
extra : rebase_source : 188bbc23a128642c1127694714e7fca4192827c9
No functional changes apart from class'ifying the file and harmonising
the export symbol with the rest of the Marionette code base by renaming
the MarionetteServer class to server.TCPListener.
MozReview-Commit-ID: 8WJKoprGGvr
--HG--
extra : rebase_source : 1f706a0f5e4c9fdccac90bfc14f767763ec85257
This makes the Marionette server itself set a long list of recommended
automation preferences when it starts up, and reset those it changed
when stopping.
Preferences used in automation are currently written to the Firefox
profile before Firefox starts, but after a closer examination of the
preferences, it is thought that many of them can be set at runtime.
There is a subset of preferences that are checked on startup and which
must be set in the profile. These are clearly called out in the comments.
We still set them at runtime, since we foresee a future where it will
be possible to attach an existing Firefox session to geckodriver, and
many of the prefs can also be checked at runtime during the course of
that automation session.
For example, if we would not set the "app.update.auto" preference in
such a runtime, opening the About dialogue would cause a forced update
of Firefox. This is not desirable when the browser is under Marionette
control. When the Marionette server is stopped, the altered preferences
are reset and the browser session's state is returned to its pre-existing
condition.
This change does not mean it is dangerous or wrong for consumers to write
their own preferences to the profile. Any preferences written to the
profile will take precedence over this set of recommended preferences.
If the recommended Marionette preference has a user-defined value (i.e. it
is written to the profile before starting up or has manually changed),
that user-set value is preferred.
The list of preferences in this file is the authorative reference of
recommended preferences for using Marionette in automation. They have
been gathered from geckoinstance.py and geckodriver.
MozReview-Commit-ID: INHSQRg2XjF
--HG--
extra : rebase_source : e1684133d287d2891feaa52ae4d267e8df4fa8e2
By using a callback the usual shutdown logic from quitApplication() is not executed and as such
will create a race-condition for the client when trying to re-connect to the server. To fix that
we have to stop the server from accepting new connections until the application has been completely
shutdown.
Also delete_session() has to be called for the default in_app shutdown logic and when using a callback.
MozReview-Commit-ID: GmIM2GGwQ2P
--HG--
extra : rebase_source : 56f8ba75f9297fa4de0a143fe5c5017529d0b528
The emulator code was originally hacks to allow us to instrument the emulator
from JavaScript in the B2G world. Since we no longer support this it is being
removed.
MozReview-Commit-ID: 3XDk21SFfUc
--HG--
extra : rebase_source : 63bc081c3ab37894b97b873fe142ee068b609318
This does not appear to be in use.
MozReview-Commit-ID: B4M335Lb1UM
--HG--
extra : histedit_source : 241a896d0701c529cf56636eff567211198839cb
extra : rebase_source : 0b30f291ed1aee3f4073f2fea47ac4d9c6a6a576
extra : commitid : I8NVDyxCC0e
extra : source : 22321e6b65e987a76e42f880c8aa5a0427052259
extra : intermediate-source : 3b9e9a027fa7f020ac80c060938488f53f61049c
This change removes almost all the remaining uses of loadSubScript and
global scope pollution. The only remaining use is for common.js, which
is resolved by a later bug for evaluating scripts.
MozReview-Commit-ID: 96h0yLElauq
--HG--
extra : histedit_source : 70f70a8aeffef3fca18addfa3fca575a9128e11a
extra : rebase_source : c251c58a7a086c606d3d3941adfeee26ecc49504
extra : commitid : 8XlX4zVZQUN
extra : source : 6bb93562a57656e6cc744c3c901a5ec80f9ec4d8
extra : intermediate-source : ad5bf32d8fef351a0bc4d6249bd16a34aa83f548
This does not appear to be in use.
MozReview-Commit-ID: B4M335Lb1UM
--HG--
extra : commitid : I8NVDyxCC0e
extra : rebase_source : be6fddfe28cbe626114c38416c97075ee5cdf3a4
extra : source : 22321e6b65e987a76e42f880c8aa5a0427052259
extra : histedit_source : 241a896d0701c529cf56636eff567211198839cb
This change removes almost all the remaining uses of loadSubScript and
global scope pollution. The only remaining use is for common.js, which
is resolved by a later bug for evaluating scripts.
MozReview-Commit-ID: 96h0yLElauq
--HG--
extra : commitid : 8XlX4zVZQUN
extra : rebase_source : a5c8057c7ce0f52dc319f2e9d0937d6a4aab84d4
extra : source : 6bb93562a57656e6cc744c3c901a5ec80f9ec4d8
extra : histedit_source : 70f70a8aeffef3fca18addfa3fca575a9128e11a
This does not appear to be in use.
--HG--
extra : commitid : I8NVDyxCC0e
extra : rebase_source : 757f75ecd813873513fb9bd56625c59d3d0936b3
extra : histedit_source : 241a896d0701c529cf56636eff567211198839cb
This change removes almost all the remaining uses of loadSubScript and
global scope pollution. The only remaining use is for common.js, which
is resolved by a later bug for evaluating scripts.
--HG--
extra : commitid : 8XlX4zVZQUN
extra : rebase_source : b5420c4ba5298a7e972e7b14a13325bb8ea1a540
extra : histedit_source : 70f70a8aeffef3fca18addfa3fca575a9128e11a
A distinct advantage is that try...catch statements are no longer used
to control the flow of code.
--HG--
extra : rebase_source : e3dcadcf9fdfcfe9d227b571b5a830437428762c
extra : source : 2b6d148fd941363e4580137e5d6efc0eebdaf7bd
A distinct advantage is that try...catch statements are no longer used
to control the flow of code.
--HG--
extra : rebase_source : 402890020719b04245aa7c601f52752cb43c0666
Message sequencing allows Marionette to provide an asynchronous,
parallel pipelining user-facing interface, limit chances of payload
race conditions, and remove stylistic inconsistencies in how commands
and responses are dispatched internally.
Clients that deliver a blocking WebDriver interface are still be expected
to not send further command requests before the response from the last
command has come back, but if they still happen to do so because of
programming error or otherwise, no harm will be done. This will guard
against bugs such as bug 1207125.
This patch formalises the command and response concepts, and applies
these concepts to emulator callbacks. Through the new message format,
Marionette is able to provide two-way parallel communication. In other
words, the server will be able to instruct the client to perform a
command in a non ad-hoc way.
runEmulatorCmd and runEmulatorShell are both turned into command
instructions originating from the server. This resolves a lot of
technical debt in the server code because they are no longer special-cased
to circumvent the dispatching technique used for all other commands;
commands may originate from either the client or the server providing
parallel pipelining enforced through message sequencing:
client server
| |
msgid=1 |----------->|
| command |
| |
msgid=2 |<-----------|
| command |
| |
msgid=2 |----------->|
| response |
| |
msgid=1 |<-----------|
| response |
| |
The protocol now consists of a "Command" message and the corresponding
"Response" message. A "Response" message must always be sent in reply
to a "Command" message.
This bumps the Marionette protocol level to 3.
r=dburns
r=jgriffin
--HG--
extra : commitid : 1kz4Oa2q3Un