Commit Graph

463 Commits

Author SHA1 Message Date
Andreas Tolfsen
bd75d1ac7c Bug 1391691 - Make WebDriver:MinimizeWindow idempotent. r=automatedtester
MozReview-Commit-ID: 4XBw0UFfZ1O

--HG--
extra : rebase_source : ced1fb5e6add0b2688c3e6cc0740eb9a9e54456a
2017-08-18 18:30:50 +01:00
Andreas Tolfsen
d93ed539e8 Bug 1391691 - Rename GeckoDriver#fullscreen to fullscreenWindow. r=automatedtester
The other window state manipulation commands are named minimizeWindow
and maximizeWindow.

MozReview-Commit-ID: IBVqJSRwG8x

--HG--
extra : rebase_source : a1efaf7cf2a5c068b62c60453b1f8814d34b043b
2017-08-18 18:29:47 +01:00
Wes Kocher
75e9f7dbef Backed out 10 changesets (bug 1391691) for wpt failures a=backout
Backed out changeset 666ac679317e (bug 1391691)
Backed out changeset 46f82e1e2cde (bug 1391691)
Backed out changeset 1fd98ace1473 (bug 1391691)
Backed out changeset 5bddbd90ec7c (bug 1391691)
Backed out changeset 4653134d01ef (bug 1391691)
Backed out changeset fd88b612ac2e (bug 1391691)
Backed out changeset 6306abc0b5e9 (bug 1391691)
Backed out changeset 649b0e761c87 (bug 1391691)
Backed out changeset 6c48daaad075 (bug 1391691)
Backed out changeset 17aeed1f6454 (bug 1391691)

MozReview-Commit-ID: 6Cw1QibNQKM

--HG--
extra : rebase_source : 0197f824719f11e113595dd9a4a86b2c8d1fd8fe
2017-08-21 09:19:10 -07:00
Andreas Tolfsen
ab34c37f43 Bug 1391691 - Make WebDriver:FullscreenWindow idempotent. r=automatedtester
MozReview-Commit-ID: 4AQlYYNV03f

--HG--
extra : rebase_source : ab85f647405a23d249c3c79413382004b9d5ba90
2017-08-18 18:32:11 +01:00
Andreas Tolfsen
fd1746e875 Bug 1391691 - Make WebDriver:MaximizeWindow idempotent. r=automatedtester
MozReview-Commit-ID: EJ0VQOTWysg

--HG--
extra : rebase_source : 8fa9ab528c30f11d791b0e49f36661957f19befa
2017-08-18 18:31:42 +01:00
Andreas Tolfsen
9e4a620575 Bug 1391691 - Make WebDriver:MinimizeWindow idempotent. r=automatedtester
MozReview-Commit-ID: 4XBw0UFfZ1O

--HG--
extra : rebase_source : c2de251b5e994710ae197e63b7413a321f490900
2017-08-18 18:30:50 +01:00
Andreas Tolfsen
017325b653 Bug 1391691 - Rename GeckoDriver#fullscreen to fullscreenWindow. r=automatedtester
The other window state manipulation commands are named minimizeWindow
and maximizeWindow.

MozReview-Commit-ID: IBVqJSRwG8x

--HG--
extra : rebase_source : 29271a475a847ca15c1d8f736520b238c0818791
2017-08-18 18:29:47 +01:00
Andreas Tolfsen
5906316d3c Bug 1388036 - Restore window when setting window rect. r=automatedtester
If the window is minimized when setting the window rect, restore it
before resizing or moving the window.  We already exit fullscreen,
so this brings parity to the WebDriver:SetWindowRect command.

MozReview-Commit-ID: KrvWJjKX1eA

--HG--
extra : rebase_source : 968317ae961c8292edbadf2b4cfe439b7dc11f56
2017-08-18 16:01:24 +01:00
Andreas Tolfsen
c44c39fe1c Bug 1391952 - Disable camel case lint for input and output. r=automatedtester
MozReview-Commit-ID: 5KargkSvSPn

--HG--
extra : rebase_source : 45974434b348aed13a50fe4c98f11fc39217723c
2017-08-19 14:21:43 +01:00
Andreas Tolfsen
6c36c123e0 Bug 1391952 - Lint testing/marionette. r=automatedtester
MozReview-Commit-ID: CdA2gkIaul7

--HG--
extra : rebase_source : a3c4b785da01c19d8ef41cb3628a4844ec518ca2
2017-08-19 14:22:17 +01:00
Andreas Tolfsen
ac8a376af8 Bug 1388082 - Convert execute script methods to async. r=automatedtester
MozReview-Commit-ID: 6oUZ4v8snh0

--HG--
extra : rebase_source : 1ce7c286b0bce68ffaf74a6c8235ce57ca39af8a
2017-08-07 16:53:02 +01:00
Andreas Tolfsen
351fdfb92f Bug 1388082 - Make WebDriver service use async/await. r=automatedtester
MozReview-Commit-ID: A1dW91OvGcG

--HG--
extra : rebase_source : af8cf1d157f2fe4fdcd0e96b06ebe87e23d22a73
2017-08-07 16:52:37 +01: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
Sebastian Hengst
b52285fffc merge mozilla-inbound to mozilla-central. r=merge a=merge
MozReview-Commit-ID: LBuvGxGDK9k
2017-08-06 11:05:44 +02:00
Andreas Tolfsen
da6629ba61 Bug 1387559 - Drop session_id fallback for WebDriver:NewSession. r=automatedtester
The WebDriver service in the remote protocol accepts sessionId and
session_id and we only need on.  All known consumers are using sessionId,
and we can drop the session_id fallback.

MozReview-Commit-ID: 6fa5Lgkzwfu
2017-08-05 17:35:54 +01:00
Andreas Tolfsen
5ec99cbafd Bug 1387457 - Convert element click functions to async. r=automatedtester
The element click functions in testing/marionette/interaction.js are
generator functions using "yield".  This patch converts them to async
functions.

MozReview-Commit-ID: 4A4cTaY619w
2017-08-05 17:21:06 +01:00
Andreas Tolfsen
e6afed160b Bug 1381876 - Ensure Maximize Window is synchronous. r=automatedtester
Because the sizemodechange event is not synchronous on all platforms,
we additionally need to await the window's dimensions to change.

However, if the window manager does not have a notion of a maximised
state, this operation too could time out.  However, it is believed
that the additional wait will allow for the window to transition to the
required state in this scenario.

MozReview-Commit-ID: KeHJMKSJfjQ

--HG--
extra : rebase_source : 797b3be8f6adb027f15dd638f22afa6efd0f0432
2017-08-01 18:30:52 +01:00
Andreas Tolfsen
adf6b1ae3e Bug 1381876 - Return window rect from Context#rect consistently. r=automatedtester
MozReview-Commit-ID: D5pCPK2PEr3

--HG--
extra : rebase_source : a9e6c80314084a6b9fe3b4313d1599911528297b
2017-08-01 18:17:29 +01:00
Phil Ringnalda
2685e4feb0 Backed out changeset 8bd84dfdba0d (bug 1387457) for eslint bustage
MozReview-Commit-ID: 4wgm2jnoDsl
2017-08-04 19:41:37 -07:00
Andreas Tolfsen
2777c1c3a7 Bug 1387457 - Convert element click functions to async. r=automatedtester
The element click functions in testing/marionette/interaction.js are
generator functions using "yield".  This patch converts them to async
functions.

MozReview-Commit-ID: 4A4cTaY619w

--HG--
extra : rebase_source : 1b6f1b545f438ae253fd4024500bf41536d976aa
2017-08-04 15:45:02 +01:00
Andreas Tolfsen
d29f92675d Bug 1385547 - Lint testing/marionette. r=automatedtester
Automatic fixes from './mach lint --fix testing/marionette'.

MozReview-Commit-ID: 4UOLrLLxMbH
2017-07-31 16:01:12 +01: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
dd7a57fd22 Bug 1384517 - Fix testing/marionette API docs; r=automatedtester
Various fixes to make the generated API documentation from
testing/marionette somewhat easier to read.

MozReview-Commit-ID: F9duuQoOYBt

--HG--
extra : rebase_source : 3ade69773ceba42826aedef05b1371240b51cf82
2017-07-26 13:11:53 +01:00
Andreas Tolfsen
57744ed223 Bug 1378227 - Reintroduce window test for Marionette:GetWindowRect; r=whimboo
When linting the Marionette server code,
https://searchfox.org/mozilla-central/commit/de001d80b777ff0fcfa823a52e8d49b4981af040
accidentally removed the missing window check from the
Marionette:GetWindowRect command.  This change reintroduces the
check that was accidentally removed.

MozReview-Commit-ID: FkDOUKR2dIi

--HG--
extra : rebase_source : abc32aec9b005f341d1e1deb1bbc9a3132dd35cb
2017-07-09 17:15:28 +01:00
Henrik Skupin
29253dbd89 Bug 1374672 - Use documentURI instead of baseURI. r=automatedtester
baseURI isn't actually we have to check for to get the
current documents URI. Therefore documentURI exists.

MozReview-Commit-ID: CDhOZ8lU2qJ

--HG--
extra : rebase_source : c53f79468a7d319bd5e7aa40338fce0ca7299bd4
2017-07-07 15:36:08 +02:00
Henrik Skupin
618082fc0c Bug 1332122 - Re-register the browser for frame script reloads. r=automatedtester
With multi-processes for content reloads of the frame script
can happen at any time, and not only for remoteness changes.
As such the current browser has to be re-registered with the
new id of the listener.

MozReview-Commit-ID: 48MOZfuPTR9

--HG--
extra : rebase_source : 60e91ae7e1cdc942d0ac9a9dd3aac3baeccc5ddf
2017-07-06 18:02:19 +02:00
Henrik Skupin
d373a550b4 Bug 1332122 - Remove unnecessary wrapper browser.startSession(). r=automatedtester
This wrapper just calls back into the MarionetteDriver, and
doesn't have any value. Removing it simplifies the call stack.

MozReview-Commit-ID: GH1xUHX12Xi

--HG--
extra : rebase_source : a3b9e57e63809c9936fdb2686ad6016339ea7bf7
2017-07-04 10:27:54 +02:00
Henrik Skupin
c9b6fbb461 Bug 1378191 - Use JSON to send capabilities in "Marionette:listenersAttached" r=automatedtester
By not using the JSON format when sending the capabilities to the
frame script, the values cannot be correctly decoded. As result
the capabilities will be reset to their default values for the
listener, and can cause various failures.

MozReview-Commit-ID: KaryoJiyd30

--HG--
extra : rebase_source : 206e45755d3ea9b6cbf2f2022a9a364dcf22d78e
2017-07-04 21:03:36 +02:00
Henrik Skupin
3aa7fa87be Bug 1368439 - Retrieve content browser title via parent process. r=automatedtester
To retrieve the title of the currently selected content browser
it is not necessary to call into the frame script. Instead just
take the value from the parent process directly.

MozReview-Commit-ID: KEpYKLIydrJ

--HG--
extra : rebase_source : 8b179de7057f8655a81656bd4d95b1562edb9f54
2017-07-02 04:31:18 -07:00
Henrik Skupin
2af21d96fe Bug 1368439 - Remove unused GetAppCacheStatus command. r=automatedtester
MozReview-Commit-ID: ARETprd7n8t

--HG--
extra : rebase_source : cacb5051de689f73156f4460bcd47de0f09f2df1
2017-07-02 13:55:12 +02:00
Andreas Tolfsen
de001d80b7 Bug 1376128 - Lint testing/marionette; r=automatedtester
MozReview-Commit-ID: DY4yCSBEZrN

--HG--
extra : rebase_source : d4e25369418cc72a6ee9f78d44b050a87403391d
2017-06-29 16:40:24 -07:00
Andreas Tolfsen
8f8617afe9 Bug 1376128 - Remove duplicated command entries; r=automatedtester
getContext and setContext are duplicated further up under the Marionette
serivce entries.

MozReview-Commit-ID: 2V5S2XG6wDw

--HG--
extra : rebase_source : 1f22adc294c063f014e3a0e884a01ed6a7fbe43e
2017-06-28 11:14:16 -07:00
Andreas Tolfsen
b86d19c98a Bug 1376128 - Expose unrecognised eslint globals; r=automatedtester
In particular, XPCNativeWrapper should probably be made available
by default.

MozReview-Commit-ID: E1oYFyApbLi

--HG--
extra : rebase_source : 4e27ad6882bd4e43dadc97d4fd2a186e01510dfd
2017-06-28 11:04:14 -07:00
Andreas Tolfsen
54c2f296a7 Bug 1376128 - Use selective imports from error module; r=automatedtester
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
2017-06-28 11:01:49 -07:00
Andreas Tolfsen
0025816358 Bug 1376586 - Add back quitApplication command alias; r=davehunt
The quitApplication command was accidentally removed in 1e96a289d28a.
This adds it back as a recognised command alias in order to not break
geckodriver.

MozReview-Commit-ID: IZ0h8dv9ILt

--HG--
extra : rebase_source : 61550dae3a71973a2028d6384bc3eab388c17c21
2017-06-27 14:48:36 -07:00
Henrik Skupin
200da78a40 Bug 1223277 - Return immediately when click command closes tab or window. r=ato
In some cases the click command can trigger the closing of the
currently selected tab or window. To not cause a hang when waiting
for a response from the removed framescript, the tab and window
closing events have to be observed. Also the command has to return
immediately.

MozReview-Commit-ID: 9WeXryrKEJr

--HG--
extra : rebase_source : a7a23cf19e55eecbf957d48c2182a601d63d0909
2017-06-26 16:55:02 -07:00
James Graham
5fd8e99e6a Bug 1363428 - Add reftest-specific endpoints to Marionette, r=ato
This adds commands to start a reftest session, run a test, and end the
session. It as assumed that after you start a reftest session you will
just run reftests until you end the session. When starting a session
the user provides a string indicating when screenshots should be
taken, and an object mapping urls to a count of the number of times
that url is expected to be used in the session, to help with
caching. Running the tests takes a url to a test, an expected status,
a timeout, and a nested list of possible references, in which each
entry at a specific level is combined by OR and nested references are
combined by AND.

The implementation is heavilly inspired by the existing reftest
harness, starting a minimal window with no tabs, and loading the urls
directly in there. In order to get a screenshot in the e10s case we
have to pass the DRAW_VIEW and USE_WIDGET_LAYERS flags when taking the
screenshot.

For performance we heavily cache canvases; for references that will be
repeated we cache the full canvas with image, and we also cache a
single canvas to use for all other screenshots to avoid the overhead
of repeatedly creating a new canvas element.

MozReview-Commit-ID: JOFvtmH7tg
2017-06-24 12:03:11 +01:00
James Graham
90846c0258 Bug 1363428 - Make it possible to close tabless content windows, r=ato
MozReview-Commit-ID: 8xltsYCN3QA
2017-06-24 12:03:10 +01:00
James Graham
dc2eb76fe1 Bug 1363428 - Handle top level reftest window specially in Marionette, r=ato
Because this window is a normal Firefox window but doesn't contain any
tabs, the normal Marionette functions for iterating over windows don't
work well. As a sort of hack, identify this window by the id of its
root element, and special case it when finding windows in Marionette.

MozReview-Commit-ID: LxPv13YDXDu
2017-06-24 12:03:10 +01:00
James Graham
860166c010 Bug 1363428 - Refactor Marionette switchToWindow implementation, r=ato
This allows other commands to implicitly change the window handle, by
calling findWindow with appropriate arguments to get a window
properties object and then passing that to setWindowHandle.

MozReview-Commit-ID: 4NpYxjsMM4T
2017-06-24 12:03:10 +01:00
James Graham
2994bec9c1 Bug 1363428 - Use an iterator for iterating windows, r=ato
MozReview-Commit-ID: FKsw9EST2H7
2017-06-24 12:03:10 +01:00
Wes Kocher
ea40157e54 Backed out 16 changesets (bug 1363428) for Wr failures a=backout CLOSED TREE
Backed out changeset e86d6d5c2a25 (bug 1363428)
Backed out changeset a0687a63e7b9 (bug 1363428)
Backed out changeset 858dc97498c7 (bug 1363428)
Backed out changeset 582a8dce7932 (bug 1363428)
Backed out changeset 26ae2fd48587 (bug 1363428)
Backed out changeset 7fa8e20fe001 (bug 1363428)
Backed out changeset 829c13a75667 (bug 1363428)
Backed out changeset a94d2c400b04 (bug 1363428)
Backed out changeset ec4a6b343b37 (bug 1363428)
Backed out changeset c27b94038e71 (bug 1363428)
Backed out changeset d1c03b96d270 (bug 1363428)
Backed out changeset 60c1c95b46ca (bug 1363428)
Backed out changeset b0604d88973f (bug 1363428)
Backed out changeset f0b218979773 (bug 1363428)
Backed out changeset 1d359561373c (bug 1363428)
Backed out changeset 956d6c0a646e (bug 1363428)

MozReview-Commit-ID: K8EBA8ACZLC
2017-06-23 14:13:27 -07:00
James Graham
c9e960f859 Bug 1363428 - Add reftest-specific endpoints to Marionette, r=ato
This adds commands to start a reftest session, run a test, and end the
session. It as assumed that after you start a reftest session you will
just run reftests until you end the session. When starting a session
the user provides a string indicating when screenshots should be
taken, and an object mapping urls to a count of the number of times
that url is expected to be used in the session, to help with
caching. Running the tests takes a url to a test, an expected status,
a timeout, and a nested list of possible references, in which each
entry at a specific level is combined by OR and nested references are
combined by AND.

The implementation is heavilly inspired by the existing reftest
harness, starting a minimal window with no tabs, and loading the urls
directly in there. In order to get a screenshot in the e10s case we
have to pass the DRAW_VIEW and USE_WIDGET_LAYERS flags when taking the
screenshot.

For performance we heavily cache canvases; for references that will be
repeated we cache the full canvas with image, and we also cache a
single canvas to use for all other screenshots to avoid the overhead
of repeatedly creating a new canvas element.

MozReview-Commit-ID: JOFvtmH7tg

--HG--
extra : rebase_source : ab5a2ef2e450b9bbdc6bc3c9487ed5dfda2c1d4b
2017-05-10 10:51:10 +01:00
James Graham
2859180072 Bug 1363428 - Make it possible to close tabless content windows, r=ato
MozReview-Commit-ID: 8xltsYCN3QA

--HG--
extra : rebase_source : d872ea84c98203485815b5082088ce148e2b4411
2017-06-09 18:28:10 +01:00
James Graham
c5fde398ab Bug 1363428 - Handle top level reftest window specially in Marionette, r=ato
Because this window is a normal Firefox window but doesn't contain any
tabs, the normal Marionette functions for iterating over windows don't
work well. As a sort of hack, identify this window by the id of its
root element, and special case it when finding windows in Marionette.

MozReview-Commit-ID: LxPv13YDXDu

--HG--
extra : rebase_source : 8c0aa7a4aeff69e1d7c86ba7cbb6c421abd0c31d
2017-05-09 19:05:49 +01:00
James Graham
5615725398 Bug 1363428 - Refactor Marionette switchToWindow implementation, r=ato
This allows other commands to implicitly change the window handle, by
calling findWindow with appropriate arguments to get a window
properties object and then passing that to setWindowHandle.

MozReview-Commit-ID: 4NpYxjsMM4T

--HG--
extra : rebase_source : 9b53d8b10e2341624c3add5e9975aab47e0b320f
2017-05-09 18:59:09 +01:00
James Graham
a79e689564 Bug 1363428 - Use an iterator for iterating windows, r=ato
MozReview-Commit-ID: FKsw9EST2H7

--HG--
extra : rebase_source : 87ae70226adf947e4b7990348ba94b277cff11d1
2017-05-09 17:49:09 +01: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
9737c986a6 Bug 1223277 - Return immediately when click command closes tab or window. r=ato
In some cases the click command can trigger the closing of the
currently selected tab or window. To not cause a hang when waiting
for a response from the removed framescript, the tab and window
closing events have to be observed. Also the command has to return
immediately.

MozReview-Commit-ID: 9WeXryrKEJr

--HG--
extra : rebase_source : 682d67d51109c57a6de1a129492ebb5b635d7c56
2017-05-24 21:44:37 +02:00