Commit Graph

2636 Commits

Author SHA1 Message Date
Sebastian Hengst
1703ff1640 Backed out changeset 5afb0e2ec86c (bug 1364319) for failing Marionette's test_window_rect.py TestSize.test_resize_while_fullscreen on Linux opt. r=backout 2017-06-14 21:31:22 +02:00
Andreas Tolfsen
1011a734c2 Bug 1364319 - Throttle setWindowRect with requestAnmationFrame; r=maja_zf
We need to delay the response from the setWindowRect command until the
window has had time to properly resize.  But because the DOM resize
event is not synchronous, we cannot rely on it alone to tell us when the
widget toolkit has actually completed the resizing.

To overcome this problem we throttle the event using
ChromeWindow.requestAnimationFrame to force the event loop to flush
before resolving the promise.

The setWindowRect command previously relied on a 15 FPS setTimeout delay
because requestAnimationFrame did not work with ChromeWindow, but this
seems to have since been fixed.  Local tests show that this approach is
more stable and produces less intermittent results.

MozReview-Commit-ID: D1ICb3F6vX3

--HG--
extra : rebase_source : 786fe9843f2cbc29e4708dd8db279fd4a273fe51
2017-06-12 13:52:53 +01:00
Wes Kocher
e4ecc079ae Backed out changeset 7492cd4b4cb3 (bug 1364319) for marionette failures in test_window_rect.py a=backout
MozReview-Commit-ID: GLjm9aICQjd
2017-06-13 16:18:02 -07:00
Andreas Tolfsen
0b692f9d4d Bug 1364319 - Throttle setWindowRect with requestAnmationFrame; r=maja_zf
We need to delay the response from the setWindowRect command until the
window has had time to properly resize.  But because the DOM resize
event is not synchronous, we cannot rely on it alone to tell us when the
widget toolkit has actually completed the resizing.

To overcome this problem we throttle the event using
ChromeWindow.requestAnimationFrame to force the event loop to flush
before resolving the promise.

The setWindowRect command previously relied on a 15 FPS setTimeout delay
because requestAnimationFrame did not work with ChromeWindow, but this
seems to have since been fixed.  Local tests show that this approach is
more stable and produces less intermittent results.

MozReview-Commit-ID: D1ICb3F6vX3

--HG--
extra : rebase_source : 90dba4abf64c820b11e1edb5e0e96133cbcfa76a
2017-06-12 13:52:53 +01: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
Wes Kocher
101940382d Merge m-c to autoland, a=merge CLOSED TREE
MozReview-Commit-ID: K0rvhhOLins
2017-06-12 17:13:12 -07:00
Wes Kocher
f8412cddff Merge inbound to central, a=merge CLOSED TREE
MozReview-Commit-ID: 4j8ngmg8FAD
2017-06-12 17:02:56 -07:00
Sebastian Hengst
4f35de100b Backed out changeset c932f9b1d502 (bug 1368195) for flake8 linting failure at base.py:855:17 | continuation line under-indented for visual indent (E128). r=backout 2017-06-12 18:21:51 +02:00
Ryan VanderMeulen
97dbdf639a Bug 1371924 - Skip test_execute_script.py TestExecuteContent.test_return_value_on_alert on Android. r=ato 2017-06-12 10:24:16 -04:00
Andreas Tolfsen
f2225720a9 Bug 1370863 - Remove log and getLogs commands from Marionette; r=automatedtester
MozReview-Commit-ID: HFZfJGwSqyT

--HG--
extra : rebase_source : eb04f0a3fa55d17eb5fef9bff3170ba5ce147eff
2017-06-07 14:17:41 +01: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
8737f25318 Bug 1370863 - Stop using Marionette.log API in harness; r=automatedtester
MozReview-Commit-ID: 33ZPdJ486rJ

--HG--
extra : rebase_source : dbba433041d7f265b67205ea97e1cf9770f5c0c5
2017-06-09 14:27:27 +01:00
Maja Frydrychowicz
91b92d5836 Bug 1370899 - mock_runner.driverclass should return mock_marionette; r=whimboo
Previously, mock_runner.driverclass() returned a plain Mock object.

MozReview-Commit-ID: 1RMQhud4BJD

--HG--
extra : rebase_source : 54d7f62444e66bc2f9ae07c0b5ed91cd9a3cbbaf
2017-06-07 10:32:04 -04:00
Andreas Tolfsen
e828570043 Bug 1371658 - Remove CommonTestCase.setup_SpecialPowers_observer; r=whimboo
SpecialPowers has been removed from Marionette, and this method does not
appear to be used anywhere in mozilla-central.

MozReview-Commit-ID: 3hkPVNJw0iA

--HG--
extra : rebase_source : a5cb71ece7d40dbbcb9ae5a532b74d69cd7b209c
2017-06-09 15:08:07 +01:00
Andreas Tolfsen
6848748f06 Bug 1368195 - Remove BaseMarionetteTestRunner.appinfo; r=maja_zf,whimboo
BaseMarionetteTestRunner.appinfo is used in two places: when logging
whether E10s is enabled at the beginning of a test run, and for comparing
a few properties in the WebDriver capabilities test.

It currently tries to serialise Services.appinfo, which has
a field QueryInterface, which is a function.  Because of the
Function.prototype.inherits field, this serialisation results in an
infinite recursion, presumably because the inherits method itself is
a function.

This patch removes BaseMarionetteTestRunner.appinfo as it is a clunky and
potentially error-prone implementation due to the way it caches appinfo,
and replaces the current consumers with functions retrieving specific
properties from Services.appinfo.

MozReview-Commit-ID: BPDA6TJrHHb

--HG--
extra : rebase_source : 763c18f2c71412140e4ca21854e1e05514112d0e
2017-05-27 17:58:55 +01:00
Henrik Skupin
62b45a10eb Bug 1368492 - Add currentURL property to the driver and context class. r=ato
Multiple commands rely on the current URL of the chrome window, or
the active content browser. The newly added properties help to ease
the retrieval of the URL for both chrome and content scope.

MozReview-Commit-ID: 2KAtRzHxxNc

--HG--
extra : rebase_source : 85e4192f8a01fe4e1735f7812612decba0db1ad5
2017-05-31 16:49:56 +02:00
Henrik Skupin
8907d0b29a Bug 1368492 - Add assert.browsingContext for parent process. r=ato
When accessing a property of the current content browser from
the parent process, the current top-level browsing context has
to be valid.

MozReview-Commit-ID: BZHJTk1j5Nj

--HG--
extra : rebase_source : 7e44fc6e05d7fb1429fb3e36e897cf51b3d9142f
2017-05-31 16:44:49 +02:00
Andreas Tolfsen
4911a20921 Bug 1368195 - Remove BaseMarionetteTestRunner.appinfo; r=maja_zf,whimboo
BaseMarionetteTestRunner.appinfo is used in two places: when logging
whether E10s is enabled at the beginning of a test run, and for comparing
a few properties in the WebDriver capabilities test.

It currently tries to serialise Services.appinfo, which has
a field QueryInterface, which is a function.  Because of the
Function.prototype.inherits field, this serialisation results in an
infinite recursion, presumably because the inherits method itself is
a function.

This patch removes BaseMarionetteTestRunner.appinfo as it is a clunky and
potentially error-prone implementation due to the way it caches appinfo,
and replaces the current consumers with functions retrieving specific
properties from Services.appinfo.

MozReview-Commit-ID: BPDA6TJrHHb

--HG--
extra : rebase_source : cb97953b7110f3d6dda75fbe3a1fd7dcffcef0c2
2017-05-27 17:58:55 +01:00
Andreas Tolfsen
afba0a5aaf Bug 1370871 - Remove "global" global from evaluate script context; r=automatedtester
Marionette exposes a global called "global" to scripts that are
evaluated in sandboxes.  This is no longer needed after the rewrite of
the testing/marionette/evaluate.js module.

MozReview-Commit-ID: BobdwilaCy0

--HG--
extra : rebase_source : 96df7df0711eba9833b7e1198ffab0768b87e5cb
2017-06-07 14:24:24 +01:00
Andreas Tolfsen
fec9a028f3 Bug 1370850 - Serialise undefined script evaluation return value to null; r=maja_zf
When a call through the content frame proxy is interrupted by the
dialogueObserver, the synchronous promise that is meant to wait for a
response from the frame script is resolved immediately with an undefined
return value.

When an undefined value is assigned to the response body, it gets dropped
during JSON serialisation.  To ensure the "value" field expected from
the Execute Script and Execute Async Script commands is populated,
we need to assign a null value to resp.body.value.

We can treat undefined as null by calling evaluate.toJSON again on the
return value from the proxied frame script call.  This effectively means
we serialise it twice, since it first needs to be serialised to cross
the IPC border, though the second computation only looks at primitives
and no known web element store is required.

It would be nicer if the content frame script itself would be able to
return early with null by installing a user prompt notification event,
but this is not possible because the tabmodal dialogue that appears
blocks script execution.  This means we need to rely on the
dialogueObserver in testing/marionette/proxy.js to take care of the
dialogue for us.

MozReview-Commit-ID: D14TA2TYYXI

--HG--
extra : rebase_source : 5fc17a1f0786e2fc9a2d054ef7c1f8b0e3336906
2017-06-07 12:46:14 +01:00
Sebastian Hengst
6203a7b696 Backed out changeset eaef7cd5e288 (bug 1370850) for failing modified Marionette test test_execute_script.py TestExecuteContent.test_return_value_on_alert. r=backout 2017-06-08 20:06:53 +02: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
Andreas Tolfsen
239a225f5a Bug 1370850 - Serialise undefined script evaluation return value to null; r=maja_zf
When a call through the content frame proxy is interrupted by the
dialogueObserver, the synchronous promise that is meant to wait for a
response from the frame script is resolved immediately with an undefined
return value.

When an undefined value is assigned to the response body, it gets dropped
during JSON serialisation.  To ensure the "value" field expected from
the Execute Script and Execute Async Script commands is populated,
we need to assign a null value to resp.body.value.

We can treat undefined as null by calling evaluate.toJSON again on the
return value from the proxied frame script call.  This effectively means
we serialise it twice, since it first needs to be serialised to cross
the IPC border, though the second computation only looks at primitives
and no known web element store is required.

It would be nicer if the content frame script itself would be able to
return early with null by installing a user prompt notification event,
but this is not possible because the tabmodal dialogue that appears
blocks script execution.  This means we need to rely on the
dialogueObserver in testing/marionette/proxy.js to take care of the
dialogue for us.

MozReview-Commit-ID: D14TA2TYYXI

--HG--
extra : rebase_source : 3b2405111b0f027b1fd6281d075ab6dbb2259591
2017-06-07 12:46:14 +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
Maja Frydrychowicz
84b2b0814a Bug 1367430 - Set modifier-key properties for mouse action; r=ato
When synthesizing a MouseEvent for the performActions command,
set shiftKey, ctrlKey, etc., based on inputStateMap.

MozReview-Commit-ID: Knw3gxuAcSB

--HG--
extra : source : afcfa17be8acdd3d1b88b2bf8d6deffb53c52af1
2017-05-24 16:42:04 +02:00
Carsten "Tomcat" Book
dc95c2f7ad Backed out changeset afcfa17be8ac (bug 1367430) for making bug 1365021 worse
--HG--
extra : rebase_source : e655ab964901f8fa3c4993ccf46b1c812b3957e7
2017-06-07 13:21:05 +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
David Burns
d83f55e070 Bug 1368674 - Remove JS Test support in Marionette Harness r=maja_zf
MozReview-Commit-ID: 11Zc7KL3djD

--HG--
extra : rebase_source : de8274b3948abcbe0e0aa404dad9b02b87b9119f
2017-05-30 15:07:19 +01:00
David Burns
db1c923084 Bug 1368674 - Remove simpleTest functionality from Marionette. r=whimboo
This is a remanent of the B2G code for injecting Mochitest style tests
into Gecko. This is no longer used by anything and is now dead code.

MozReview-Commit-ID: 4qaB3vxQzon

--HG--
extra : rebase_source : 7297648ed73faf326dc98f9c26604a447d658beb
2017-05-30 13:51:02 +01:00
Maja Frydrychowicz
149cdbbd02 Bug 1367430 - Set modifier-key properties for mouse action; r=ato
When synthesizing a MouseEvent for the performActions command,
set shiftKey, ctrlKey, etc., based on inputStateMap.

MozReview-Commit-ID: Knw3gxuAcSB

--HG--
extra : rebase_source : 499f6987fbc237662c925c7fedc83611e4de148b
2017-05-24 16:42:04 +02:00
Brendan Dahl
3491e1213b Bug 1294075 - Disable marionette accessibility test on headless. 2017-06-06 09:45:38 -07:00
Jessica Jong
62de86ac19 Bug 1369413 - Remove the use of const INPUT_DATETIME_PREF. r=ato
MozReview-Commit-ID: 5Orzh1X7Ln2

--HG--
extra : amend_source : 5bf1aefca05bebe08cbca5cc4c2da0fe8d3c3130
2017-06-02 02:52:00 -04:00
Dão Gottwald
8a952aed25 Bug 1367076 - Set datareporting.policy.firstRunURL by default to replace data choices infobar with privacy policy in a background tab on first run. r=Gijs
MozReview-Commit-ID: 9r5el0I2HrA

--HG--
extra : rebase_source : d5bc0f8a5dea60d4d3bbaaf5332d8f022693d381
2017-05-31 13:48:06 +02:00
Florian Quèze
bb8b90d00e Bug 1369700 - Delay initialization of marionette.js until delayed startup and startup tests are finished, r=ato.
Before this patch, marionette.js starts its initialization right after receiving the "sessionstore-windows-restored" notification.
This is unfortunate for the browser_startup.js browser chrome mochitest added in bug 1358798, because it causes lots of marionette file to appear to be loaded before the browser is ready to handle user events.
2017-06-02 22:08:21 +02:00
Ryan VanderMeulen
17e61d02f4 Backed out 3 changesets (bug 1368674) for Android test failures. a=merge
Backed out changeset ff3c813fcdea (bug 1368674)
Backed out changeset 0d9bb636b9a9 (bug 1368674)
Backed out changeset 1d0202706572 (bug 1368674)

MozReview-Commit-ID: CrCFYIEDH4o

--HG--
extra : source : bf5e8ffae40db7b2c2afcb1851fb8eb80b98e5b6
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
David Burns
dd5ef53ea6 Bug 1368674 - Remove JS Test support in Marionette Harness r=maja_zf
MozReview-Commit-ID: 11Zc7KL3djD

--HG--
extra : rebase_source : 2f0d9995b5ba40e5338fe458395d15abf7704825
2017-05-30 15:07:19 +01:00
David Burns
8cb144921e Bug 1368674 - Remove simpleTest functionality from Marionette. r=whimboo
This is a remanent of the B2G code for injecting Mochitest style tests
into Gecko. This is no longer used by anything and is now dead code.

MozReview-Commit-ID: 4qaB3vxQzon

--HG--
extra : rebase_source : 3af2c7655ecd2d03f266d0a1ad02eadfea1b1a0b
2017-05-30 13:51:02 +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
David Burns
69ac306da8 Bug 1368674 - Remove JS Test support in Marionette Harness r=maja_zf
MozReview-Commit-ID: 11Zc7KL3djD

--HG--
extra : rebase_source : 7c8f78df2e6aa402cacf04819c03abb3381815f2
2017-05-30 15:07:19 +01:00
David Burns
58b95498e0 Bug 1368674 - Remove simpleTest functionality from Marionette. r=whimboo
This is a remanent of the B2G code for injecting Mochitest style tests
into Gecko. This is no longer used by anything and is now dead code.

MozReview-Commit-ID: 4qaB3vxQzon

--HG--
extra : rebase_source : b4b7e66452b7ce7335ef5f509957121f403d7043
2017-05-30 13:51:02 +01:00
Jessica Jong
efe6bfa010 Bug 1366188 - Part 1: Fix Marionette's DateTimeValue when dom.forms.datetime is enabled. r=ato
When we enable "dom.forms.datetime", <input type=date> and <input type=time>
are displayed as multi-field text box, where the fields are ordered depending
on locale. To avoid too much overhead, instead of synthesising each key event,
we set the element's value property and fire the corresponding events to
emulate user interaction.

MozReview-Commit-ID: Ao6ip61CNT6

--HG--
extra : rebase_source : f03d9c5d2e2540e6c2189b542d9270be5fb63919
2017-05-30 23:37:00 +02:00
Brendan Dahl
c2eeb53896 Bug 1367227 - Part 2 - Trigger fullscreen the same way Firefox does. r=ato 2017-05-31 16:29:20 -07:00
David Burns
fa48a67c05 Bug 1368648: Remove importScript functionality from Marionette r=ato
This removes importScript functionality that was used extensively for
B2G testing but is no longer used in tree.

MozReview-Commit-ID: 1O7GWCZPWRZ

--HG--
extra : rebase_source : dc57710690116d9f473271f88f43f298590e895e
2017-05-30 11:25:14 +01:00
Henrik Skupin
37b8ffef76 Bug 1368526 - Wait for the page to be loaded in a newly opened tab/window. r=ato
If a web page gets opened in a new tab or window, there is no way for
the navigate command to check the current page load status. Instead
we have to wait until the correct URL is getting reported.

MozReview-Commit-ID: JQhPXRgh5Ae

--HG--
extra : rebase_source : 9b60d62af5d4cec2c1a693e152510807165755ba
2017-05-30 11:25:21 +02:00
Henrik Skupin
2d096423ea Bug 1368101 - getCurrentUrl can retrieve the URL via the chrome process. r=ato
There is no reason for the command to call into the content framescript.
It's only adding overhead and can currently cause hangs if the framescript
gets reloaded.

Instead use the content browser which is always aware of the current URL.

MozReview-Commit-ID: 9Ui7qClFEWJ

--HG--
extra : rebase_source : e428e71ddb66e0152d164f2aebd20efb0593ceec
2017-05-26 20:37:36 +02:00
David Burns
8f530fdf8b Bug 1179335: Remove unused Marionette mouse scroll functions; r=whimboo
The underlying code that this method calls from nsIDOMWindowUtils
was removed and has not caused issues in here. This is dead code.

MozReview-Commit-ID: K245et5SmxJ

--HG--
extra : rebase_source : f5345219b9e9ae9299a1884c3424f2d8bfdf3d20
2017-05-29 13:57:05 +01:00