Commit Graph

1237 Commits

Author SHA1 Message Date
Wes Kocher
3985469cdb Bug 1388424 - Fix flake8 issue a=me
MozReview-Commit-ID: 4OcGtGQfgyD
2017-08-11 13:04:38 -07:00
Andreas Tolfsen
94e1614eb3 Bug 1388424 - Read capabilities off top-level object. r=whimboo
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
2017-08-11 11:06:15 +02:00
Andreas Tolfsen
a791c795cb Bug 1387380 - Stop capabilities negotiation in Marionette. r=whimboo
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
2017-08-04 20:04:12 +01:00
Masatoshi Kimura
8b713b2b0f Bug 1375125 - Stop using nsILocalFile in the tree. r=froydnj
This mechanically replaces nsILocalFile with nsIFile in
*.js, *.jsm, *.sjs, *.html, *.xul, *.xml, and *.py.

MozReview-Commit-ID: 4ecl3RZhOwC

--HG--
extra : rebase_source : 412880ea27766118c38498d021331a3df6bccc70
2017-08-04 17:49:22 +09:00
Yangyi Peng
fbec312f36 Bug 1378121 - Add WebDriver:MinimizeWindow command to Marionette; r=ato
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
2017-07-21 17:00:41 +08:00
Andreas Tolfsen
357f761f38 Bug 1381347 - Use deprecated quitApplication command in Marionette client; r=whimboo
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
2017-07-17 20:19:30 +01:00
Henrik Skupin
bc0f54dd08 Bug 1366199 - Release marionette-harness 4.1 and marionette-driver 2.3.0. r=maja_zf
MozReview-Commit-ID: GOrSXY8aHFJ

--HG--
extra : rebase_source : 05f6ff7b25bf55a5f7a073e1ddfca57d3a26287b
2017-06-28 10:18:13 -07:00
Henrik Skupin
d96b3fb2bc Bug 1223277 - TcpTransport.close() should't care about errno 107. r=ato
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
2017-06-22 21:10:44 +02:00
Henrik Skupin
97651e224a Bug 1375259 - Fix FennecInstance.close() for removal of restart keyword. r=ato
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
2017-06-23 14:52:41 +02:00
Ryan VanderMeulen
dacc2546ba Backed out 6 changesets (bug 1223277) for causing Marionette test regressions.
Backed out changeset 85c86dc86122 (bug 1223277)
Backed out changeset aacd8d27b192 (bug 1223277)
Backed out changeset e6921a7229a3 (bug 1223277)
Backed out changeset b9f95fc81d23 (bug 1223277)
Backed out changeset 547744157e2a (bug 1223277)
Backed out changeset afbaa1138de3 (bug 1223277)
2017-06-23 12:15:23 -04:00
Henrik Skupin
99b7841d93 Bug 1223277 - TcpTransport.close() should't care about errno 107. r=ato
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
2017-06-22 21:10:44 +02:00
Andreas Tolfsen
5c81559723 Bug 1375425 - Remove deprecated commands; r=automatedtester
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
2017-06-22 10:42:55 +01:00
Andreas Tolfsen
2a8d5de8c8 Bug 1370863 - Remove Marionette.log API from client; r=automatedtester
MozReview-Commit-ID: FjBQ2p1DyLn

--HG--
extra : rebase_source : 00561c25a0432fb8042ea0f5ba2e6b6563272d00
2017-06-09 14:28:15 +01:00
Henrik Skupin
9a0cf91c1c Bug 1373635 - Application profile has only be reset if explicitly requested. r=ato
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
2017-06-16 15:31:45 +02:00
Ignaz Forster
594e4143ba Bug 1352023: Fix broken references / typos in Marionette docs; r=whimboo
MozReview-Commit-ID: 6Wo8ewMacjF

--HG--
extra : rebase_source : 6b297bee5851f9bde4c64381ac502e7dabace029
2017-06-08 23:40:55 +02:00
Wes Kocher
8b6a6ce487 Backed out 5 changesets (bug 1370863) for marionette test failures a=backout CLOSED TREE
Backed out changeset e4605e515ffd (bug 1370863)
Backed out changeset 986d20fecd11 (bug 1370863)
Backed out changeset b0a081dfd577 (bug 1370863)
Backed out changeset bb80abe6a298 (bug 1370863)
Backed out changeset 90b14cb85f51 (bug 1370863)

MozReview-Commit-ID: chPvs0RWbK
2017-06-12 17:18:38 -07:00
Andreas Tolfsen
acbfad9780 Bug 1370863 - Remove Marionette.log API from client; r=automatedtester
MozReview-Commit-ID: FjBQ2p1DyLn

--HG--
extra : rebase_source : 141b3bd768bbe7c5cce108a8ffefa5514773f366
2017-06-09 14:28:15 +01:00
Andreas Tolfsen
e626269aea Bug 1370857 - Remove Marionette.import_script API; r=automatedtester
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
2017-06-07 13:13:50 +01:00
Andreas Tolfsen
76f413411c Bug 1370857 - Remove Marionette.clear_imported_scripts API; r=automatedtester
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
2017-06-07 13:12:46 +01:00
Henrik Skupin
1f73453256 Bug 1366784 - Force quit the application if requested quit or restart doesn't happen. r=maja_zf
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
2017-06-08 15:59:07 +02:00
David Burns
1b71e9f3bb Bug 1368674 - Remove B2G Permissionis handling from Marionette. r=ato
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
2017-06-06 13:55:23 +01:00
David Burns
21aac9bd4d Bug 1368674 - Remove setTestName functionality from Marionette r=whimboo
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
2017-05-30 16:28:36 +01:00
Ryan VanderMeulen
6e98307c04 Backed out 3 changesets (bug 1368674) for Android test failures.
Backed out changeset ff3c813fcdea (bug 1368674)
Backed out changeset 0d9bb636b9a9 (bug 1368674)
Backed out changeset 1d0202706572 (bug 1368674)
2017-06-01 19:21:31 -04:00
David Burns
5fe3dc363a Bug 1368674 - Remove setTestName functionality from Marionette r=whimboo
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
2017-05-30 16:28:36 +01:00
Ryan VanderMeulen
e36ce0e346 Backed out 3 changesets (bug 1368674) for flake8 failures.
Backed out changeset 9aa183c8533e (bug 1368674)
Backed out changeset 837ccbc38bfc (bug 1368674)
Backed out changeset 7f4f851da483 (bug 1368674)
2017-06-01 16:54:10 -04:00
David Burns
06b3c56c83 Bug 1368674 - Remove setTestName functionality from Marionette r=whimboo
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
2017-05-30 16:28:36 +01:00
Ryan VanderMeulen
acb2f518fc Merge inbound to m-c. a=merge 2017-05-19 11:46:56 -04:00
Francois Marier
39b6d88744 Bug 1364959 - Clean up Safe Browsing preferences in tests. r=dimi
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
2017-05-18 16:18:59 -07:00
Geoff Brown
d844ac12ec Bug 1364228 - Increase marionette startup timeout for Linux mochitests; r=ato
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.
2017-05-17 10:30:32 -06:00
David Burns
2b14993449 Bug 1189749: Implement full screen support in Marionette r=ato
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
2017-05-08 16:41:35 +01:00
Michal Novotny
133308dd0d Bug 1361435 - Remove references to unused pref network.http.bypass-cachelock-threshold, r=mcmanus
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.
2017-05-04 17:37:42 +02:00
Andreas Tolfsen
cf773b33a8 Bug 1355888 - Mark marionette.enabled pref in client as a deprecated; r=whimboo
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
2017-04-13 15:08:49 +01:00
Brendan Dahl
a071a0f003 Bug 1356681 - Expand headless mode support for linux. r=automatedtester,jrmuizel,kanru
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.
2017-05-18 17:47:10 -07:00
Mike Conley
365f4e988a Bug 1352501 - Remove Reader Mode promotion panel. r=jaws,MattN
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
2017-04-19 16:42:10 -04:00
Andreas Tolfsen
a01b7b7f4e Bug 1353074 - Use mutable sandboxes for selection API; r=maja_zf
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
2017-04-17 14:47:28 +01:00
Henrik Skupin
726ee660f9 Bug 1358402 - Keep 'marionette.defaultPrefs.enabled' around as fallback. r=ato a=tomcat
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
2017-04-21 11:16:06 +02:00
Jim Porter
3517459260 Bug 1352069 - Introduce a pref that allows for disabling cosmetic animations r=jaws
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
2017-04-11 13:47:31 -05:00
Phil Ringnalda
13057a9bc3 Backed out 8 changesets (bug 1353074) for Marionette crashes in test_accessiblecaret_selection_mode.py and timeouts in test_click.py
CLOSED TREE

Backed out changeset 824c46ad23f9 (bug 1353074)
Backed out changeset a6249ce2b09e (bug 1353074)
Backed out changeset 56027ec27fb8 (bug 1353074)
Backed out changeset c8d2b2c701a6 (bug 1353074)
Backed out changeset 28eb1c784875 (bug 1353074)
Backed out changeset 811a3e45bf11 (bug 1353074)
Backed out changeset 764220600b06 (bug 1353074)
Backed out changeset d7af70f65c2c (bug 1353074)
2017-04-18 19:09:51 -07:00
Andreas Tolfsen
5e3cdb7bf1 Bug 1353074 - Use mutable sandboxes for selection API; r=maja_zf
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
2017-04-17 14:47:28 +01:00
Andreas Tolfsen
ab9085d475 Bug 1354323 - Accept string text for sendKeysToDialog command; r=automatedtester
As a follow-up to https://bugzilla.mozilla.org/show_bug.cgi?id=1354323,
this makes the Marionette sendKeysToDialog command take a text field
with a string, instead of the value field with an array of strings.

The relevant WebDriver specification change is
https://github.com/w3c/webdriver/pull/889.

Fixes: https://github.com/mozilla/geckodriver/issues/607

MozReview-Commit-ID: AY52pAK2582

--HG--
extra : rebase_source : f767ae09e5f415e6e944ececfb83c442f23407f3
2017-04-06 23:37:04 +01:00
Henrik Skupin
8b95b9033d Bug 1348872 - Check for existent modal dialogs for new Marionette sessions. r=ato
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
2017-03-28 22:47:57 +02:00
Henrik Skupin
31a07e639d Bug 1348872 - Wait() should accept None as timeout and interval. r=ato
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
2017-03-28 22:47:43 +02:00
Andreas Tolfsen
b47aa9dcf9 Bug 1351371 - Disable recommended automation prefs in CI; r=maja_zf
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
2017-03-28 17:30:22 +01:00
David Burns
acf4662f21 Bug 1347589: Implement Marionette Get Window Rect. r=ato
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
2017-03-24 13:54:37 +00:00
David Burns
54c2a05c8d Bug 1347589: Implementation of Marionette Set Window Rect. r=ato
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
2017-03-24 14:35:38 +00:00
David Burns
7e5554522e Bug 1348782: Updated expected key parameter for sendKeysToElement. r=ato
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
2017-03-24 21:37:43 +00:00
Andreas Tolfsen
d594cb5ef8 Bug 1337743 - Rename quitApplication command quit; r=whimboo
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
2017-03-27 12:53:27 +01:00
Andreas Tolfsen
601e23ab3b Bug 1337743 - Stop appending eAttemptQuit in quitApplication; r=jgraham,whimboo
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
2017-02-09 18:35:00 +00:00
Andreas Tolfsen
0d576f8c4f Bug 1337743 - Make session and param checks safer against falsy values; r=whimboo
MozReview-Commit-ID: 8M79WmiRfkE

--HG--
extra : rebase_source : 12cf1d3bfb59d4ddd53b2017da59ef8a6220db52
2017-02-09 18:15:26 +00:00
Andreas Tolfsen
bf17093d1b Bug 1342162 - Make timeout API in client backwards compatible; r=whimboo
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
2017-03-23 16:22:34 +00:00