geckodriver sends capabilities as a JSON Object in the body of the
command, like this:
[0,1,"newSession",{"acceptInsecureCerts":true}]
With https://bugzil.la/1387380 we wanted the Marionette Python client
to match this behaviour, however the patch overlooked the fact that
the server reads cmd.parameters.capabilities, meaning it looks for a
"capabilities" field on this object instead of treating the object as
the dictionary of capabilities.
As a follow-up to that bug, this patch removes the ability to override
the session ID by specifying a "sessionId" field. This functionality
was only used for in-app restart tests. When Firefox restarts, the
Marionette session is arguably not the same, and sessions should not
live on between restarts.
This patch will fix capabilities passed from geckodriver and align the
Marionette Python client.
For backwards compatibility reasons, it needs to be possible to use the
Python client with older Firefoxen that reads cmd.parameters.capabilities
instead of cmd.parameters. This is why we duplicate the capabilities
object, like geckodriver does.
MozReview-Commit-ID: DCpaxl9hOLe
The geckodriver HTTPD proxy implements WebDriver conforming capabilities
negotation and it is unnecessary to do this in the Marionette WebDriver
service. The capabilities matching that Marionette implements is also
not as good as the implementation found in geckodriver.
The WebDriver:NewSession command will still accept a JSON Object of
"configuration" capabilities that carry the pre-matched capabilities from
geckodriver. These will be used as configuration options for the session.
Type- and bounds checks will still be performed on this input.
MozReview-Commit-ID: CROjgGuTXOG
--HG--
extra : rebase_source : eb7e9f69fe3b23b77ea497d758fe30ac93d6373c
This mechanically replaces nsILocalFile with nsIFile in
*.js, *.jsm, *.sjs, *.html, *.xul, *.xml, and *.py.
MozReview-Commit-ID: 4ecl3RZhOwC
--HG--
extra : rebase_source : 412880ea27766118c38498d021331a3df6bccc70
Implements the backend for the WebDriver standard's Minimize Window
command.
Signed-off-by: Andreas Tolfsen <ato@sny.no>
MozReview-Commit-ID: F5Z38LxhOJm
--HG--
extra : rebase_source : 81c8d78ad8d9ae66a8ab37e635cce9af518224de
Firefox update tests will break if we do not use the
`quitApplication' command, since the `quit' command is not available
in Firefox 53.
MozReview-Commit-ID: KJoCPBh9NKh
--HG--
extra : rebase_source : b6bba278f812d1757011fb2a947281a7224c4e10
Beside Errno 57 there is also Errno 107 (Transport endpoint is not
connected) which can happen in case of an unexpected crash/shutdown
of Firefox. Then calling shutdown() on the socket to stop the
communication will fail.
This is most likely a race and can happen after receiving a reply
from the server, and before sending another command.
MozReview-Commit-ID: 3S5Ko4XVUAJ
--HG--
extra : rebase_source : 59d79ab5da2c4e67b64bc90501660a7603a993c8
On bug 1373635 the restart keyword has been removed from
GeckoInstance.close(), but it was missed for FennecInstance,
which calls this method.
MozReview-Commit-ID: 5cEFJ6JXIVl
--HG--
extra : rebase_source : 057db73615fa59107bc37585a8cc516e693ea851
Beside Errno 57 there is also Errno 107 (Transport endpoint is not
connected) which can happen in case of an unexpected crash/shutdown
of Firefox. Then calling shutdown() on the socket to stop the
communication will fail.
This is most likely a race and can happen after receiving a reply
from the server, and before sending another command.
MozReview-Commit-ID: 3S5Ko4XVUAJ
--HG--
extra : rebase_source : f808ee62188255ae1aaabac8e1fd3691eba6b2e6
The "timeouts" command could have been removed in Firefox 55, and
"quitApplication" can be removed with Firefox 56.
MozReview-Commit-ID: Fe7x8Yy0vSb
--HG--
extra : rebase_source : fc8b2c3c27f76a472cbdd8681efff06ca60e00f7
For both quit() and restart() methods the profile should not be reset,
unless it has been requested. The current behavior breaks various tests
which make use of quit() and session_start() and which assume that
previously set preferences are still set, eg. sessionrestore tests.
MozReview-Commit-ID: 4BxSSJPrTYF
--HG--
extra : rebase_source : 534c0608caf31c1e2cc256ad3fa8ae1972204603
Removes the Marionette.import_script API as it is not used by any
consumers of the client, including the Firefox UI tests.
MozReview-Commit-ID: 3xceYXZZVR0
--HG--
extra : rebase_source : 7422704737da599704125874a6f52e4eeb670dfd
The import script functionality was removed in
https://bugzilla.mozilla.org/show_bug.cgi?id=1368648, but the
Marionette.clear_imported_script API was not removed from the client.
We are currently making calls after every test to the clearImportedScripts
command in the server, but we are apparently ignoring the ‘unknown
command’ error that is being returned.
MozReview-Commit-ID: KVjh2IfhuUY
--HG--
extra : rebase_source : ebc8faf8746e7e3e91b395ec488aeea014747848
In case a quit or restart is requested, but eg. the in_app
callback doesn't really trigger a shutdown of the application,
Marionette has to force close it after the default shutdown
timeout.
This is necessary because "acceptConnections" is set to false
and no further connection could be made to the still running
application.
MozReview-Commit-ID: GwSeYyjI6M9
--HG--
extra : rebase_source : 52a9b0dcc2b8b7710925f25ec48f4ad5b5e96c64
The Permissions API was used extensively during B2G to make sure the
state of the browser and permissions for APIs were in the relevant
state. This code is no longer used and can be removed.
MozReview-Commit-ID: HgcQe3GEd09
--HG--
extra : rebase_source : 08187e93b6729faae8a1913573d57add752dbb46
setTestName was used for logging which test was being run for the
JS Tests used in B2G.
MozReview-Commit-ID: FNF4Sm7vAYM
--HG--
extra : rebase_source : cbb6667bb0d8be65c34c6e84b70caf21c6b3c34d
setTestName was used for logging which test was being run for the
JS Tests used in B2G.
MozReview-Commit-ID: FNF4Sm7vAYM
--HG--
extra : rebase_source : b12fd8ce04e7da739a8a5ec0e7b30b6734c58e4a
setTestName was used for logging which test was being run for the
JS Tests used in B2G.
MozReview-Commit-ID: FNF4Sm7vAYM
--HG--
extra : rebase_source : 6ad739d2ff9bf3d6bafaed0450c8794a257657e7
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
Our linux32-debug build is very slow to startup when running mochitests on aws.
Sometimes we see similar behavior on other linux platforms. Intermittently,
in this environment, startup takes longer than the 120 seconds that marionette
waits, resulting in test failures in bug 1261598. Increasing the marionette
startup timeout to 180 seconds appears to effectively avoid these failures.
This implements the Full Screen method described in the WebDriver specification
(http://w3c.github.io/webdriver/webdriver-spec.html#fullscreen-window) as well as
tests for it.
MozReview-Commit-ID: GKec7GNE6rm
--HG--
extra : rebase_source : 92d427b40d6aeb760783e67d4796a56bb0dbc6cb
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.
To preserve backwards compatibility for in-app restarts using
Services.startup.quit(eRestart), we want to continue using the
marionette.enabled preference in the Python client until the patch
introducing the MARIONETTE environment variable (preceding this) makes
it into an official release.
This is due to the fact that the Marionette Python client is being
used for upgrade tests, and it is needs to stay compatible with all
release trains.
MozReview-Commit-ID: KstsJRu4lIP
--HG--
extra : rebase_source : 01a00549a9c8b57fd65aad8cd68ef04fdcca981d
Full Firefox on Linux can now be run with a --headless flag.
This includes seven parts:
1) Running all marionette tests in headless mode.
2) Prevents crashes where Firefox calls into GTK.
3) Adds a headless screen helper which supports changing the headless
screen size with the environment variables MOZ_HEADLESS_WIDTH and
MOZ_HEADLESS_HEIGHT.
4) Supports simulating moving a headless window.
5) Adds a stubbed out nsSound implementation.
6) Supports simulating size mode changes of headless windows.
7) Adds the --headless flag for Firefox.
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
Injected script in the Marionette caret selection API used the "default"
immutable sandbox, but we want to run them in the mutable sandbox.
MozReview-Commit-ID: BpbHdDhDtg4
--HG--
extra : rebase_source : 2b710ca483f1732d91527820006da5da331b5df3
With bug 1344748 landed the default preferences and their handling has been
changed. Builds starting with Firefox 54.0 can handle that, but previous
releases don't enable Marionette at all after a restart under special
conditions (invalidating 'update.status' file before the restart).
To prevent the bustage we have to keep the preference
'marionette.defaultPrefs.enabled' around until the next ESR release
is out.
MozReview-Commit-ID: AB3liJlb6M7
--HG--
extra : amend_source : 35ae31af3c1a44d9ad965dbeb395297a73e86a81
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
Injected script in the Marionette caret selection API used the "default"
immutable sandbox, but we want to run them in the mutable sandbox.
MozReview-Commit-ID: BpbHdDhDtg4
--HG--
extra : rebase_source : 4193a01370e903874aa5da1634bdfe5c2b9fd577
To ensure that Marionette can also detect modal dialogs opened right after
the application starts, and before Marionette has been initialized, the modal
dialog detection code has to be delayed until a new session actually gets
started. Then it's not enough to only register the observer notification, but
it should also be checked for open modal or tab modal dialogs.
MozReview-Commit-ID: ChYcR3I59DW
--HG--
extra : rebase_source : 68f13620a41d0535f96abe4d1b25d41a6b428120
Setting the default value for both the timeout and interval should not
be done in the parameter list, but dependent on if None is passed in
or not.
MozReview-Commit-ID: 4VwHfTkrwDk
--HG--
extra : rebase_source : 31abac0cf53e9035296462360d316d856fed5689
This tells Marionette to not set the recommended automation preferences in
testing/marionette/server.js when started. We only want to use this set
of recommended prefs for public consumers of Marionette, and not when we
are testing Gecko itself as they may interfere with expectations of tests.
MozReview-Commit-ID: 4InVBRBnUTG
--HG--
extra : rebase_source : bfac0cff617651417cfa71ac0c80af73d583c827
Brings the getWindowPosition and getWindowSize calls into
one call. This aligns Marionette with the W3C WebDriver call
`Get Window Rect`.
MozReview-Commit-ID: ItWI6YpCJkx
--HG--
extra : rebase_source : c08daa9ba0a31a2f2082a7d460619e817180bf22
This implements Set Window Rect from the W3C WebDriver specification
to allow us to change the size and position of a window in one call
MozReview-Commit-ID: KxwJyyjg1VU
--HG--
extra : rebase_source : e2f32e4c674847b336c5eeb772d24fff595e2075
The expected command parameter has been updated from `value`
to `text`. This aligns marionette with W3C WebDriver
Send Keys To Element command.
MozReview-Commit-ID: EkQ1UJ58V7f
--HG--
extra : rebase_source : 1706113816eb4184334330e237e07c1f480d4500
This shortens the name of the quitApplication Marionette command to
`quit'.
The client is not updated since it is used for Firefox upgrade tests.
It can be updated to use `quit' when Firefox 56 ships.
MozReview-Commit-ID: Gq5KWMS1AzF
--HG--
extra : rebase_source : dfaf557f658595bfa5b8d1d294d6d6525f5d2abf
Change Marionette's quitApplication command to accept an optional array
of masks for Services.startup.quit. If no masks are provided or the flags
field is not provided, we assume nsIAppInfo.eAttemptQuit as the default.
This deviates from the current behaviour whereby eAttemptQuit is
unconditionally included when passed an array of flags. This is
problematic because Services.startup.quit does not allow combinations
of *Quit flags, e.g. eAttemptQuit and eForceQuit cannot be combined.
MozReview-Commit-ID: FVqdaXFA4aC
--HG--
extra : rebase_source : 10074c53294a6596ecbd09a3f6ec477f3f8ed452
This makes the session timeout duration configuration API backwards
compatible with earlier Firefoxen.
As Marionette changes to accept pageLoad, we must still continue to allow
"page load" as a key for as long as the Marionette Python client is used
for Firefox upgrade tests.
MozReview-Commit-ID: Ln4D3bY2d7f
--HG--
extra : rebase_source : 0ee6c33e0bfbb1605e250db2adea77942808855f