Граф коммитов

651 Коммитов

Автор SHA1 Сообщение Дата
Henrik Skupin 6d73c8d8f2 Bug 1368965 - Don't inject chrome window handles into window handles. r=ato
Chrome window handles and window handles are identifiers for different types
of windows. As such those should not be mixed up. Especially for chrome
windows without a tabbrowser we erroneously inject such a chrome window
handle. It can break those tests which assume it's a tab.

MozReview-Commit-ID: 1n2vOyfaSUh

--HG--
extra : rebase_source : 08ebff867a0075191908bc7aa535f3f8b386871d
2017-06-13 18:08:44 +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
Wes Kocher 101940382d Merge m-c to autoland, a=merge CLOSED TREE
MozReview-Commit-ID: K0rvhhOLins
2017-06-12 17:13:12 -07: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 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 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
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
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
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 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
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
Brendan Dahl 3491e1213b Bug 1294075 - Disable marionette accessibility test on headless. 2017-06-06 09:45:38 -07: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
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
Ryan VanderMeulen e128706d91 Bug 1367227 - Fix incorrect syntax. r=me 2017-05-23 18:51:05 -04:00
Ryan VanderMeulen 702559b3ad Bug 1367227 - Disable Marionette window rect tests in headless mode. r=bdahl 2017-05-23 18:08:23 -04:00
David Burns 9eca7f9f6b Bug 1367227: Disable Marionette window maximize tests in headless mode; r=bdahl
MozReview-Commit-ID: Eq2AKMfMYCs

--HG--
extra : rebase_source : 17cf56de1728bcce12c3aad6f5df33e6f8438188
2017-05-23 22:23:02 +01:00
David Burns c4d8c565b3 Bug 1364594: Exit fullscreen when Set Window Rect is invoked. r=ato
If the browser is in fullscreen mode and Set Window Rect is called
we need to exit fullscreen mode and then continue to manipulate the
browser.

As described in https://w3c.github.io/webdriver/webdriver-spec.html#set-window-rect
Step 10

MozReview-Commit-ID: 5ixhGOXVBE4

--HG--
extra : rebase_source : be2b8b6da5cf78c6263502a6cb422e2de81c742d
2017-05-22 21:54:26 +01:00
Sebastian Hengst e399d29e1d Backed out changeset 8cc336b9806d (bug 1364594) for almost permafailing Marionette-headless in either test_window_maximize.py TestWindowMaximize.test_maximize or test_window_rect.py TestSize.test_resize_while_fullscreen. r=backout 2017-05-23 13:26:27 +02:00
David Burns 8a1ed5912e Bug 1364594: Exit fullscreen when Set Window Rect is invoked. r=ato
If the browser is in fullscreen mode and Set Window Rect is called
we need to exit fullscreen mode and then continue to manipulate the
browser.

As described in https://w3c.github.io/webdriver/webdriver-spec.html#set-window-rect
Step 10

MozReview-Commit-ID: 5ixhGOXVBE4

--HG--
extra : rebase_source : be2b8b6da5cf78c6263502a6cb422e2de81c742d
2017-05-22 21:54:26 +01:00
Henrik Skupin 835de452c2 Bug 1341493 - "Intermittent test_accessibility.py TestAccessibility.test_element_visible_but_not_visible_to_accessbility | AssertionError: ElementNotAccessibleException not raised" []. r=me 2017-05-19 01:40:00 +08: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
Andreas Tolfsen 92b7eebd99 Bug 1355890 - Infer identity box background-color by computed style r=maja_zf
The test for getting a CSS value off a chrome element relied on a
hardcoded expectation value.  To reduce future maintenance, it is better
to get the computed style value and compare it against what Marionette
returns.

MozReview-Commit-ID: 3FbPHGqNEpK

--HG--
extra : rebase_source : 91c0fe0e387152f4c8de1e21c5bda64108249e36
2017-05-15 19:22:13 +01:00
Henrik Skupin 67c8a43439 Bug 1361837 - Update restart unit tests to not activate sessionrestore. r=ato
The restart unit tests were using the preference browser.startup.page
with its value set to 3. This actually causes sessionrestore to restore
the session during the next startup. Given that there is a race condition
in retrieving window handles (bug 1363368) it's better to use another
default preference which does not trigger this behavior.

MozReview-Commit-ID: 4m7qHxgI504

--HG--
extra : rebase_source : d5e29c0357dfcbe8395681f57000a7a1db769178
2017-05-16 07:55:50 +02:00
Henrik Skupin 1a3fbd0f29 Bug 1364245 - Extend delay for slow loading resource testcase to prevent intermittent. r=ato
For debug builds a delay of 1s is too short. It means that a navigation
command will return when the readyState reaches interactive for an eager
page load strategy. Also due to the slowness of the browser, the getUrl
command which gets run before the readyState check takes too long. Doing
the latter check first fixes it.

MozReview-Commit-ID: D2je04Euwf0

--HG--
extra : rebase_source : 0708fcc1eb5b7198fa45ab995de404db34b64968
2017-05-12 11:44:17 +02:00
tiago 99db7d58be Bug 1364211 - Correct variable scope in TestSize class for start_size variable. r=automatedtester
MozReview-Commit-ID: DvzhvrbsgS6

--HG--
extra : rebase_source : 0ec619f2e702c16a3b50d39bfbd8a5d1156a8fa3
2017-05-14 21:05:12 -03:00
Ryan VanderMeulen 5f9d8f5990 Backed out changeset 555b205831e7 (bug 1364245) because it didn't fully fix the problem. 2017-05-13 13:10:40 -04:00
Henrik Skupin 0cd2f844e4 Bug 1364245 - Extend delay for slow loading resource testcase to prevent intermittent. r=ato
For debug builds a delay of 1s is too short. It means that a navigation
command will return when the readyState reaches interactive for an eager
page load strategy. But due to the slowness of the browser, the next
command could already operate on a complete readyState. Delaying the load
of resources is the only possible option.

MozReview-Commit-ID: D2je04Euwf0

--HG--
extra : rebase_source : d74f276d96cd5bd2301f9dac8866f9dadc6e2937
2017-05-12 11:44:17 +02:00
Andreas Tolfsen c9a2bed65e Bug 1363053 - Return JSON representation of return value r=maja_zf
According to a recent change in the WebDriver specification, we need to
return an object's JSON representation iff it exists.

The relevant specification prose change was made in
1ee4c61c11.

This patch causes return values that have a toJSON property that is a
function, to return the value of calling said function.

MozReview-Commit-ID: GpQNE9GpjCH

--HG--
extra : rebase_source : 7192bbd484cbaa4661f2442990082aefcdd1570b
2017-05-08 18:57:09 +01:00
David Burns a7e391c346 Bug 1364213: Add Test for Set Window Rect for setting to available dimensions; r=whimboo
This adds a test to set the window size to that of the available height and width. This
was an issue before. See https://github.com/mozilla/geckodriver/issues/153

MozReview-Commit-ID: J7H8WIYiB5l

--HG--
extra : rebase_source : d1da5420ccf99cab9c0e96c869059d0feb63fbb7
2017-05-11 22:28:41 +01:00
Dão Gottwald 9cc94f157a Bug 1364090 - Detach the reload and stop buttons from the location bar. r=johannh
MozReview-Commit-ID: Ltp6EghiI44

--HG--
extra : rebase_source : f033cadab35b56cf96f25786260853a8a5f9a1ed
2017-05-11 19:16:05 +02:00
Henrik Skupin 2a458fb433 Bug 937659 - Implement page load strategy. r=ato
By using the page load strategy each navigation request has to return
when the page load has reached the expected document ready state, or
immediately if a strategy of "none" is set.

This also removes the page load checks when switching frames because
this is not part of the webdriver spec.

MozReview-Commit-ID: 3KbsDvzEG6c

--HG--
extra : rebase_source : 68170235424e181c083febd44fca6bb0c5dfec63
2017-04-19 13:22:13 +02:00
Henrik Skupin cfdbf9979c Bug 937659 - Fix deserializing of page load strategy. r=ato
The patch aligns the steps for deserializing the page load strategy with
the webdriver specification.

MozReview-Commit-ID: GnVTnhVQVkG

--HG--
extra : rebase_source : c7796817fa6d0397b4821445dc3bd87853e0e509
2017-04-19 12:32:20 +02:00
Henrik Skupin 2ef12d4a3e Bug 1318351 - Ensure that window ids are internally handled as numbers. r=ato
Right now we retrieve window handles at different locations and as
such those are sometimes numbers but also strings. Given that we have
strict comparisons when checking for the id, checks can fail.

The patch also ensures that both close() and closeChromeWindow()
methods are returning the window ids as string.

MozReview-Commit-ID: ImOLe0Z2OE1

--HG--
extra : rebase_source : fe6e7857def2fde4e8253b1bfef8dd2a7d6bd954
2017-05-09 10:25:26 +02:00
squeaks cced8e85eb Bug 1360586: Removed unused maximized variable r=automatedtester
MozReview-Commit-ID: Bd11JNGuuhk

--HG--
extra : rebase_source : 03f5ef5bd4c3f652556820567eaf6670c7d1b2b5
2017-05-09 11:29:59 -07:00
Henrik Skupin 517f62ad3a Bug 1352132 - Navigation unit tests have to wait for the page loaded in the newly opened tab. r=ato
There is a race condition for all navigation tests inside the setUp
method of the BaseNavigationTestCase class. The assert for history
items can already happen if the page hasn't been fully loaded yet.
As such a failure is thrown. To fix this we have to wait for the
page being loaded.

MozReview-Commit-ID: 9LbArVT9WqA

--HG--
extra : rebase_source : 0c64798893b64f66f39e7aca16db9b4423d78047
2017-05-08 21:18:24 +02: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
Henrik Skupin 4baa8cc9a2 Bug 1361983 - Extend page unload timer if flushEventLoop returns after beforeunload event. r=ato
In cases when the navigation trigger function returns too late and the
beforeunload event has already been fired, the page load currently gets
canceled. This happens because the page unload timer hasn't been set at
this time and the unbeforeunload handler doesn't extend its time.

With this patch a flag is used which indicates if an beforeunload
event already occurred, so when the pageunload timer notifies the page
listener the unload timer can be extended to 5s as expected.

MozReview-Commit-ID: FKK0oGEWijU

--HG--
extra : rebase_source : bf4342cfb439eb85cb87cad922054953e5cb97f3
2017-05-04 11:53:30 +02:00
Dão Gottwald 39669a550b Bug 1054740 - Stop reusing tabs when restoring windows since at this point it's counterproductive rather than a useful optimization. r=mikedeboer
MozReview-Commit-ID: EuM08mEhDqZ

--HG--
extra : rebase_source : 43fc0410045f0efe48db2ae14d56994a90bded5f
2017-05-04 14:26:32 +02:00
Sebastian Hengst 532800137b Backed out changeset db9f3b377504 (bug 1054740) for failing Marionette's test_prefs.py TestPreferences.test_clear_pref, at least on Linux in non-e10s mode. r=backout on a CLOSED TREE 2017-05-03 23:15:56 +02:00
Dão Gottwald 1d352d917c Bug 1054740 - Stop reusing tabs when restoring windows since at this point it's counterproductive rather than a useful optimization. r=mikedeboer
MozReview-Commit-ID: LhJDs9GSxuK

--HG--
extra : rebase_source : 96cb427ada78ee70368f6cb1d4cad4811681c454
2017-05-03 21:57:06 +02:00
Andrew Swan 79a787c063 Bug 1352204 Fix test issues with non-MPC extensions r=kmag
Continue to allow non-multiprocessCompatible extensions in automation.
There are a ton of places that would need to be changed, many of which
will be changing soon anyway with the non-webextensions change in 57
so this is mostly the expedient route to keeping the tree green.

MozReview-Commit-ID: EZZoDVdhLfy

--HG--
extra : rebase_source : f83472bc1c88dd0deadbe485d9002499027ff07f
2017-05-03 08:02:51 -07:00
Henrik Skupin 891449384c Bug 1357634 - Use 'beforeunload' to detect a possible page load. r=ato
Using only the different unload events to detect a page load is
unreliable because of a possible delay in starting the navigation,
which could be triggered by a slowness of the application.

By using 'beforeunload', an event will be received much earlier,
and the unload timer can be extended to a couple more seconds to
wait for the navigation request to start.

If a website has it's own 'beforeunload' listener registered,
a tab modal dialog will be opened by Firefox, and Marionette
returns from the currently active command immediately to allow
the test to handle the dialog.

MozReview-Commit-ID: 6ZUYtFJSSnz

--HG--
extra : rebase_source : 3f7b9d9d0067ed7c65a3bb8774f0a5ae8bc702c2
2017-04-28 10:27:12 +02:00
Henrik Skupin 036c6138ff Bug 1361302 - Fix clicks.html to not trigger a double navigation for history navigation. r=automatedtester
Our click + page load implementation doesn't handle complex navigation
scenarios yet. As such those should not be triggered inside our unit
tests.

MozReview-Commit-ID: Cog5vohttes

--HG--
extra : rebase_source : 7068483f041ab1895ecc921f377da9bfd420ec23
2017-05-02 16:33:25 +02:00
Sebastian Hengst a71bcd1f3c Backed out changeset 46dd4a4338a1 (bug 1352204) for timing out Talos suites g2, o and s. r=backout 2017-05-02 20:19:17 +02:00
Andrew Swan efb4f22c33 Bug 1352204 Fix test issues with non-MPC extensions r=kmag
Continue to allow non-multiprocessCompatible extensions in automation.
There are a ton of places that would need to be changed, many of which
will be changing soon anyway with the non-webextensions change in 57
so this is mostly the expedient route to keeping the tree green.

MozReview-Commit-ID: EZZoDVdhLfy

--HG--
extra : rebase_source : 34aa762917566b052ade6372280caed72fbfbe9a
2017-05-01 10:34:27 -07:00
Henrik Skupin ea0737e52e Bug 1360466 - Only handle hashchange event for the current window. r=ato
Similar to the other unload and load events during a page load,
the hashchange event should only be handled if the event's target
document is the current window.

MozReview-Commit-ID: F1LMBh5Cy4A

--HG--
extra : rebase_source : 668fd6946067989e7e732b24baf6de2e85541f21
2017-04-28 14:16:59 +02:00
Henrik Skupin 8be6debc7e Bug 1357634 - Temporarily skip test_click_number_link and test_clicking_on_a_multiline_link for intermittent failures. r=Tomcat
MozReview-Commit-ID: 3mhV5Sf4Lvj

--HG--
extra : rebase_source : 7cd187678735edcf3facbd88ac66d8370ee32479
2017-04-28 09:00:08 +02:00
Andreas Tolfsen 8f9f92f1cb Bug 1359079 - Take <select multiple> into account for obscured click test; r=whimboo
Because individual <option> elements are painted and represented in the
DOM when they belong to a <select multiple> list, the center point of
the list might be one of the options.

To take this into account, we perform an inclusive descendant check
(DOMElement.contains) to see if the <option> element is a descendant of
the container <select> element.

In the case the targetted element is the element itself, the test will
still pass since it is an _inclusive_ descendant check.  In other words,
containerEl.contains(tree[0]), if tree[0] is equal to containerEl,
will pass.

The relevant specification changes were made in
40abcefd6a.

MozReview-Commit-ID: ORX8zLxQJ

--HG--
extra : rebase_source : 87ca38df6696257d569ef1ffcb888426d1f569af
2017-04-17 17:24:19 +01:00
Andreas Tolfsen 632deccd67 Bug 1357878 - Maximize window synchronously and restore when maximized; r=maja_zf
When refactoring the tests for the Set Window Rect command, it was
discovered that the Maximize Window command was not synchronous.

This patch makes GeckoDriver#maximizeWindow synchronous by waiting for
the DOM resize event to fire before returning the window rect to the user.

It also aligns the command with the WebDriver standard by making it
restore the window to its original size when calling the command a
second time.

MozReview-Commit-ID: Ft3tn2A4m7u

--HG--
extra : rebase_source : 52b523e53dd19cc8bdc4631382c96db5906f333a
2017-04-20 17:04:58 +01:00
Andreas Tolfsen 5bd3bf699c Bug 1357878 - Prevent hang on setting window size to existing size; r=maja_zf
When the window's size is being set to the window's existing size,
Marionette unconditionally listens for the DOM resize event.  When a
window is not resized, no such event fires.

This patch skips setting the window size when the window's current size
is the requested size.  This bypasses the problem of listening for an
event that never occurs.

It also combines the window position- and size tests into a
test_window_rect.py test, since they share many of the same
characteristics.

Fixes: https://github.com/mozilla/geckodriver/issues/643
MozReview-Commit-ID: IUtCFXwT1fh

--HG--
extra : rebase_source : 43c4d0e24cf1e0dc6102af48b8fe6f075b6dd4a2
2017-04-19 21:19:36 +01:00
Andreas Tolfsen 3752f5aaf4 Bug 1359043 - Remove incorrect click/scroll test r=whimboo
The test assumes the click point is the centre of the element, whereas
WebDriver uses the _in-view_ centre point to perform clicks.

If parts of the element is rendered outside the viewport, the click
point is calculated from visible portion of the element that is seen in
the viewport.

This means that if any portion of an element is within the boundaries of
the viewport, it is clickable.  If it is not, then it is not interactable.

This change is unfortunately not accompanied with any
implementation changes, but prepares Marionette for the changes
to the Element Click implementation that will come as part of
https://bugzilla.mozilla.org/show_bug.cgi?id=1321516.

MozReview-Commit-ID: Kh0zzRrtmJ4

--HG--
extra : rebase_source : 63cc463a11d5ca085e7a96ea84dcadbe3bb90204
2017-04-17 18:39:12 +01:00
Henrik Skupin 247b5f9899 Bug 1335778 - Make element click command check for page load and wait. r=ato
If the click command triggered a page load, it should not return before
the page has been fully loaded. With this patch we allow an opt-in for
commands to make use of an unload check. It's set to 200ms right now, and
will cancel an ongoing waitForPageLoad() if no page activity is detected.

MozReview-Commit-ID: DWV53sckBS2

--HG--
extra : rebase_source : 1b7905c101b7ebf406e88c73be5d0e069b7342c0
2017-04-20 12:12:27 +02:00
Henrik Skupin fc3604eaf5 Bug 1335778 - Harden test_page_timeout_fail against intermittent failures. r=ato
Tests for page timeout durations have to use an HTTPD handler that delays
or slows down document load. Otherwise there a risk that the timeout error
is not returned before the document finishes loading.

MozReview-Commit-ID: HGGcXfCuaSH

--HG--
extra : rebase_source : c79b01ca4e56e21877c6fe94309b7b0424d9b552
2017-04-13 14:57:25 +02:00
Sebastian Hengst daa08aca84 Backed out changeset 0e6dee0ccecf (bug 1335778) 2017-04-26 14:12:17 +02:00
Sebastian Hengst 2bb5df4de7 Backed out changeset e084deb550c2 (bug 1335778) 2017-04-26 14:12:13 +02:00
Henrik Skupin d9653a7941 Bug 1335778 - Make element click command check for page load and wait. r=ato
If the click command triggered a page load, it should not return before
the page has been fully loaded. With this patch we allow an opt-in for
commands to make use of an unload check. It's set to 200ms right now, and
will cancel an ongoing waitForPageLoad() if no page activity is detected.

MozReview-Commit-ID: DWV53sckBS2

--HG--
extra : rebase_source : 455e252e85c14b4ca841f02794bf0d33133ef10a
2017-04-20 12:12:27 +02:00
Henrik Skupin 0c281b238c Bug 1335778 - Harden test_page_timeout_fail against intermittent failures. r=ato
Tests for page timeout durations have to use an HTTPD handler that delays
or slows down document load. Otherwise there a risk that the timeout error
is not returned before the document finishes loading.

MozReview-Commit-ID: HGGcXfCuaSH

--HG--
extra : rebase_source : c79b01ca4e56e21877c6fe94309b7b0424d9b552
2017-04-13 14:57:25 +02:00
Andreas Tolfsen 0c61ad5319 Bug 1359050 - Test element in view with pointer events enabled; r=maja_zf
This change makes it possible to click elements that has its
pointer-events style property set to "none".

If an element has its style property pointer-events set to "none",
the element in view test will fail due to document.elementsFromPoint
excluding it due to non-interactability.  This is only a problem when
checking if the element is inside the viewport, and not when actually
performing interaction with the element.

The relevant specification change is
ba6ee925b5.

MozReview-Commit-ID: JwZB6fm7P9A

--HG--
extra : rebase_source : 18ddf7955c7e0bc6d1d7f798aebc6e09799a99ca
2017-04-17 19:34:44 +01:00
Andreas Tolfsen 9d9b0dba43 Bug 1359004 - Add preliminary support for unexpected alerts r=whimboo
Add preliminary support for returning unexpected alert open errors when
calling commands that require it according to the WebDriver standard.

Also fixes a faulty test that seems to believe it is fine to click an
element whilst an alert is present.

Further work needs to be done on user prompts, asserts, and the handler
for user prompts in https://bugzilla.mozilla.org/show_bug.cgi?id=1264259.

MozReview-Commit-ID: BiWURoQECji

--HG--
extra : rebase_source : caa1506a0e972c7ad0da2d31993fb0b8ecc1ee17
2017-04-20 18:00:46 +01:00
Andreas Tolfsen 3535278dba Bug 1353074 - Components ctor test should not throw; r=maja_zf
Testing the return value is misleading in this case.  What we want to
test is that it does not throw due to a permissions issue.

MozReview-Commit-ID: 2Wbwou9opyF

--HG--
extra : rebase_source : 2731ddce0efcd705880a70d69ee934571a766b9a
2017-04-03 19:20:19 +01:00
Andreas Tolfsen c0a09ea48c Bug 1353074 - Run wrappedJSObject execute script tests in all sandboxes; r=maja_zf
MozReview-Commit-ID: 5u2u5alGb7Z

--HG--
extra : rebase_source : 1c4ea16db0fb7bcd5475ac93442921917aa0738b
2017-04-03 19:19:05 +01:00
Andreas Tolfsen d9784cf772 Bug 1353074 - Run Components permission test in all sandboxes; r=maja_zf
The Components.classes constructor should throw an error in both the
mutable and the "default" sandbox.

MozReview-Commit-ID: C40nZNaVWwz

--HG--
extra : rebase_source : 81ecde684967241de5fed8f61dd1c0d69d077cfb
2017-04-03 19:18:25 +01:00
Andreas Tolfsen e8db02d195 Bug 1353074 - Run globals execute script tests in all sandboxes; r=maja_zf
We accidentally only ran them in "default" and "system" before, and also
one of the arguments in the system globals test was wrong.

MozReview-Commit-ID: DmBYGsZaIVP

--HG--
extra : rebase_source : 25f72fca677a44079d727e5ff3fa147e3e28eb6e
2017-04-03 19:17:24 +01:00
Andreas Tolfsen 1f633b4770 Bug 1353074 - Test arguments in all sandboxes; r=maja_zf
We were previously missing a test for the arguments variable that is
implicitly exposed to functions.

MozReview-Commit-ID: IC6aJcUsyhd

--HG--
extra : rebase_source : 7aeb986bb4c299ef5996f7b2847e6cc2d878459f
2017-04-03 19:15:13 +01:00
Andreas Tolfsen cb1c619b93 Bug 1353074 - Use tuples for script arguments; r=maja_zf
The Python standard library uses tuples to define arguments for functions,
whenever they are invoked through meta programming.

The Marionette client only allows the list type for backwards
compatibility, so we prefer tuples in this case.

Another good argument for tuples is that tuples are immutable.

MozReview-Commit-ID: 72zPzYvBz7Q

--HG--
extra : rebase_source : 79315dd809e00c4c805bd0de3244b519e3ff286f
2017-04-03 19:14:16 +01:00
Andreas Tolfsen 42acd45542 Bug 1353074 - Make unload event safe for introspection from content; r=maja_zf
Marionette does not protect the unloadHandler in
testing/marionette/evaluate.js from content introspection or
modification, which can happen when web frameworks override
window.addEventListener/window.removeEventListener.

The script evaluation module used in Marionette relies on
sandbox.window.addEventListener/removeEventListener to throw an error when
script execution is aborted due to the document unloading itself.  If the
window.addEventListener/removeEventListener functions have been overridden
to introspect the objects that are passed, they may inadvertently touch
objects originating from chrome space, such as the unloadHandler.

Because the Gecko sandboxing system put in place strict security measures
to prevent accidental chrome-space modification from content, inspecting
the unloadHandler will throw a permission denied error once the script
has finished executing.

We have found examples in the wild of this in particular with the Angular
web framework.  This patch makes the unloadHandler safe for introspection
from web content.

Fixes: https://github.com/mozilla/geckodriver/issues/515
MozReview-Commit-ID: E2LgPhLLuDT

--HG--
extra : rebase_source : 9948585b4ac2f464a9f31868bfd2d5967e61755e
2017-04-03 18:36:43 +01:00
Henrik Skupin 910162d856 Bug 1353447 - Fix race condition in TestBackForwardNavigation.test_timeout_error. r=ato
The test doesn't care about the page load status when a timeout error happened
for a back and forward command. It only compares the urlbar for the expected
url, but doesn't actually wait for the required element on the page.

MozReview-Commit-ID: 8w0iP62rlQZ

--HG--
extra : rebase_source : a78d8530dd181084a5f45e6bffeae136a0cabb74
2017-04-24 13:08:13 +02:00
Sebastian Hengst 380838cbce merge mozilla-central to autoland. r=merge a=merge 2017-04-19 18:57:30 +02:00
Sebastian Hengst d11a1a2118 Backed out changeset 2cfb401403e3 (bug 1335778)
MozReview-Commit-ID: 7TKRyAbnbrU
2017-04-19 18:53:37 +02:00
Sebastian Hengst b1985f3e25 Backed out changeset 938d57f025ea (bug 1335778)
MozReview-Commit-ID: 1PODrjHutgJ
2017-04-19 18:53:32 +02: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
Mike Hommey 34e619d1c1 Bug 1357323 - Remove support for gonk in the build system. r=gps
Everything depending on the widget being gonk can go away, as well as
everything depending on MOZ_AUDIO_CHANNEL_MANAGER, which was only
defined on gonk builds under b2g/ (which goes away in bug 1357326).

--HG--
extra : rebase_source : 9f0aeeb7eea8417fa4e06d662d566d67ecaf2a24
2017-04-18 16:56:09 +09:00
Andreas Tolfsen 56c5b0dc4b Bug 1353074 - Components ctor test should not throw; r=maja_zf
Testing the return value is misleading in this case.  What we want to
test is that it does not throw due to a permissions issue.

MozReview-Commit-ID: 2Wbwou9opyF

--HG--
extra : rebase_source : f2a95ba66999ee430f58b7aa9de70742a209defd
2017-04-03 19:20:19 +01:00
Andreas Tolfsen ee6b3f2172 Bug 1353074 - Run wrappedJSObject execute script tests in all sandboxes; r=maja_zf
MozReview-Commit-ID: 5u2u5alGb7Z

--HG--
extra : rebase_source : 679b2932b9aeca0b6ade4604a491da0d8c5b5d3f
2017-04-03 19:19:05 +01:00
Andreas Tolfsen 765ed14a32 Bug 1353074 - Run Components permission test in all sandboxes; r=maja_zf
The Components.classes constructor should throw an error in both the
mutable and the "default" sandbox.

MozReview-Commit-ID: C40nZNaVWwz

--HG--
extra : rebase_source : ced5ccba9108f2cd0c37cf799e83913bf19afac6
2017-04-03 19:18:25 +01:00
Andreas Tolfsen d7792b04b5 Bug 1353074 - Run globals execute script tests in all sandboxes; r=maja_zf
We accidentally only ran them in "default" and "system" before, and also
one of the arguments in the system globals test was wrong.

MozReview-Commit-ID: DmBYGsZaIVP

--HG--
extra : rebase_source : 75b2f87a6c9f1b425607e0a743669b985b8f3072
2017-04-03 19:17:24 +01:00
Andreas Tolfsen 92a55cd4e1 Bug 1353074 - Test arguments in all sandboxes; r=maja_zf
We were previously missing a test for the arguments variable that is
implicitly exposed to functions.

MozReview-Commit-ID: IC6aJcUsyhd

--HG--
extra : rebase_source : d94cdf0a0f4c74b0bb3240b32ad53da107931183
2017-04-03 19:15:13 +01:00
Andreas Tolfsen 79eec2ca30 Bug 1353074 - Use tuples for script arguments; r=maja_zf
The Python standard library uses tuples to define arguments for functions,
whenever they are invoked through meta programming.

The Marionette client only allows the list type for backwards
compatibility, so we prefer tuples in this case.

Another good argument for tuples is that tuples are immutable.

MozReview-Commit-ID: 72zPzYvBz7Q

--HG--
extra : rebase_source : f9338db8adacbccd82f23a3b7a38194d747e27a1
2017-04-03 19:14:16 +01:00
Andreas Tolfsen 3e559119d6 Bug 1353074 - Make unload event safe for introspection from content; r=maja_zf
Marionette does not protect the unloadHandler in
testing/marionette/evaluate.js from content introspection or
modification, which can happen when web frameworks override
window.addEventListener/window.removeEventListener.

The script evaluation module used in Marionette relies on
sandbox.window.addEventListener/removeEventListener to throw an error when
script execution is aborted due to the document unloading itself.  If the
window.addEventListener/removeEventListener functions have been overridden
to introspect the objects that are passed, they may inadvertently touch
objects originating from chrome space, such as the unloadHandler.

Because the Gecko sandboxing system put in place strict security measures
to prevent accidental chrome-space modification from content, inspecting
the unloadHandler will throw a permission denied error once the script
has finished executing.

We have found examples in the wild of this in particular with the Angular
web framework.  This patch makes the unloadHandler safe for introspection
from web content.

Fixes: https://github.com/mozilla/geckodriver/issues/515
MozReview-Commit-ID: E2LgPhLLuDT

--HG--
extra : rebase_source : c7431630d24c42ebfd7ded3cf204c1ef245211d0
2017-04-03 18:36:43 +01:00
Henrik Skupin f1d53ae011 Bug 1335778 - Make element click command check for page load and wait. r=ato
If the click command triggered a page load, it should not return before
the page has been fully loaded. With this patch we allow an opt-in for
commands to make use of an unload check. It's set to 200ms right now, and
will cancel an ongoing waitForPageLoad() if no page activity is detected.

MozReview-Commit-ID: DWV53sckBS2

--HG--
extra : rebase_source : 2c4d2a19a006645ecd44e08a28309367bf4f8d32
2017-04-13 20:16:23 +02:00
Henrik Skupin 5578c5ec75 Bug 1335778 - Harden test_page_timeout_fail against intermittent failures. r=ato
Tests for page timeout durations have to use an HTTPD handler that delays
or slows down document load. Otherwise there a risk that the timeout error
is not returned before the document finishes loading.

MozReview-Commit-ID: HGGcXfCuaSH

--HG--
extra : rebase_source : 42f60ad9864d87601cd528a0f1accffb768ba438
2017-04-13 14:57:25 +02:00
Sebastian Hengst 548852b3a4 merge mozilla-central to autoland. r=merge a=merge 2017-04-07 22:16:26 +02:00
Henrik Skupin a3baec363f Bug 1354310 - Ensure to use page load timeout for Wait().until() in unit tests. r=ato
Tests which have to wait for a page being loaded should always use a timeout as
set via self.marionette.timeout.page_load.

MozReview-Commit-ID: HFTOYy6WYNk

--HG--
extra : rebase_source : cc2981595e2a62fd761baec8a3c15486832cc0ed
2017-04-07 09:26:23 +02:00
Phil Ringnalda 3d24dfb690 Backed out 7 changesets (bug 1353074) for crashes in test_accessiblecaret_selection_mode.py
Backed out changeset 0c075043bc43 (bug 1353074)
Backed out changeset 001f220710a2 (bug 1353074)
Backed out changeset 9c1ca76fba9b (bug 1353074)
Backed out changeset 8dcd190a0a59 (bug 1353074)
Backed out changeset 23409efe536f (bug 1353074)
Backed out changeset 8112153e0793 (bug 1353074)
Backed out changeset 2670eec1ed8a (bug 1353074)
2017-04-06 22:11:45 -07:00
Andreas Tolfsen 782bf7c317 Bug 1353074 - Components ctor test should not throw; r=maja_zf
Testing the return value is misleading in this case.  What we want to
test is that it does not throw due to a permissions issue.

MozReview-Commit-ID: 2Wbwou9opyF

--HG--
extra : rebase_source : cd056ed38b9cf7b9eb095635209fbe6b090721fd
2017-04-03 19:20:19 +01:00
Andreas Tolfsen 74899f126c Bug 1353074 - Run wrappedJSObject execute script tests in all sandboxes; r=maja_zf
MozReview-Commit-ID: 5u2u5alGb7Z

--HG--
extra : rebase_source : 4a5f4e3654c38d8f177410d23cd93db2ab20e7e3
2017-04-03 19:19:05 +01:00
Andreas Tolfsen 31840306ac Bug 1353074 - Run Components permission test in all sandboxes; r=maja_zf
The Components.classes constructor should throw an error in both the
mutable and the "default" sandbox.

MozReview-Commit-ID: C40nZNaVWwz

--HG--
extra : rebase_source : f02506f16ff409761ba09ae0f32ff2902cdf07a3
2017-04-03 19:18:25 +01:00
Andreas Tolfsen efe0198497 Bug 1353074 - Run globals execute script tests in all sandboxes; r=maja_zf
We accidentally only ran them in "default" and "system" before, and also
one of the arguments in the system globals test was wrong.

MozReview-Commit-ID: DmBYGsZaIVP

--HG--
extra : rebase_source : c9f1493ce3faed0ec2e5ad6125a4f7811a1fef03
2017-04-03 19:17:24 +01:00
Andreas Tolfsen 8cf451fca6 Bug 1353074 - Test arguments in all sandboxes; r=maja_zf
We were previously missing a test for the arguments variable that is
implicitly exposed to functions.

MozReview-Commit-ID: IC6aJcUsyhd

--HG--
extra : rebase_source : 9039dcb7fcea681d8c9cd729cca8c55701631a5c
2017-04-03 19:15:13 +01:00
Andreas Tolfsen 3516605970 Bug 1353074 - Use tuples for script arguments; r=maja_zf
The Python standard library uses tuples to define arguments for functions,
whenever they are invoked through meta programming.

The Marionette client only allows the list type for backwards
compatibility, so we prefer tuples in this case.

Another good argument for tuples is that tuples are immutable.

MozReview-Commit-ID: 72zPzYvBz7Q

--HG--
extra : rebase_source : 2406e92b8bec8a965df6457bb166fd9761513b1e
2017-04-03 19:14:16 +01:00
Andreas Tolfsen 23a0800f6f Bug 1353074 - Make unload event safe for introspection from content; r=maja_zf
Marionette does not protect the unloadHandler in
testing/marionette/evaluate.js from content introspection or
modification, which can happen when web frameworks override
window.addEventListener/window.removeEventListener.

The script evaluation module used in Marionette relies on
sandbox.window.addEventListener/removeEventListener to throw an error when
script execution is aborted due to the document unloading itself.  If the
window.addEventListener/removeEventListener functions have been overridden
to introspect the objects that are passed, they may inadvertently touch
objects originating from chrome space, such as the unloadHandler.

Because the Gecko sandboxing system put in place strict security measures
to prevent accidental chrome-space modification from content, inspecting
the unloadHandler will throw a permission denied error once the script
has finished executing.

We have found examples in the wild of this in particular with the Angular
web framework.  This patch makes the unloadHandler safe for introspection
from web content.

Fixes: https://github.com/mozilla/geckodriver/issues/515
MozReview-Commit-ID: E2LgPhLLuDT

--HG--
extra : rebase_source : 6fe4f61fd18f42fb5332a664189f3ea919db28c5
2017-04-03 18:36:43 +01:00
Geoff Brown dd80050102 Bug 1306848 - Skip TestTimeouts.test_search_timeout_found on Android; r=ato 2017-04-06 11:19:13 -06:00
Geoff Brown 3d4f8c3b4a Bug 1317121 - Skip TestTimeouts.test_search_timeout_found_settimeout on Android; r=ato 2017-04-06 11:19:12 -06:00
Carsten "Tomcat" Book 14e0b51ace merge mozilla-inbound to mozilla-central a=merge 2017-04-04 12:35:03 +02:00
Henrik Skupin e64b96f08c Bug 1291320 - Skip test_focus_after_navigation for "Unable to locate element: :focus" r=maja_zf
MozReview-Commit-ID: Kd2lrH9y5US

--HG--
extra : rebase_source : e9f970505b11c50b182a535c9ecd90ee7cc86996
2017-04-03 22:10:38 +02:00
Henrik Skupin 3055f8532d Bug 1291320 - Make refresh command synchronous. r=ato,automatedtester
Update the refresh command to make it synchronous, and let it return
once the target page has been loaded. This can be accomplished by using
the loadListener object in listener.js.

MozReview-Commit-ID: Lc8QoGFeQrY

--HG--
extra : rebase_source : 1fd914aec1c55fe91a0de773cfd7ff22b5d12167
2017-03-27 16:16:36 +02:00
Henrik Skupin bdc3b68d5c Bug 1291320 - Refactor page load algorithm for listener framescript. r=ato,automatedtester
This refactoring allows us to re-use the same load algorithm for
each command which could trigger a page load. It also takes remoteness
changes into account, and waits until the load has been done.

With this change we no longer check for readyState only, but observe
the necessary DOM events as fired for page unloads and loads. This will
help us to implement the page loading strategy later.

By observing the DOM events, I also expect a small increase of performance
for any kind of page load, given that we now return immediately and do not
have a delay of 100ms at maximum.

MozReview-Commit-ID: IVtO6KgJFES

--HG--
extra : rebase_source : 40f90e3b9d1bf0a2f9123271cd08513769616e41
2017-03-28 21:41:38 +02:00
Henrik Skupin b6b4a474d6 Bug 1291320 - Disallow slow loading page to be put into the cache. r=ato,automatedtester
To delay the page load for our slowly served example page when using the
back or forward commands, the page doesn't have to be put into the browser
cache.

MozReview-Commit-ID: 4xMjR3SakZn

--HG--
extra : rebase_source : 024b8e702d95689defcee7e12496ce531e72d651
2017-04-03 22:40:48 +02:00
Paul Bignier ff2e59d1cd Bug 1352802 - Typo fixes around 'accessible'. r=MattN
MozReview-Commit-ID: 27CyNOMXkRq

--HG--
extra : rebase_source : 30e8891fa40cb497ab695e72b179c850a3a5c8d9
2017-04-03 09:47:00 -07:00
Andreas Tolfsen b8f4b3eba9 Bug 1351738 - Improve Get Title command tests; r=maja_zf
MozReview-Commit-ID: IYCkc1TbFcc

--HG--
extra : rebase_source : 5fb1996b658b2d1b902a1c5ad277b2a56bf4edde
2017-03-29 18:16:57 +01:00
Andreas Tolfsen 6e9eb39172 Bug 1351738 - Rename test_window_title.py to test_title.py; r=maja_zf
MozReview-Commit-ID: stw093m7V6

--HG--
rename : testing/marionette/harness/marionette_harness/tests/unit/test_window_title.py => testing/marionette/harness/marionette_harness/tests/unit/test_title.py
rename : testing/marionette/harness/marionette_harness/tests/unit/test_window_title_chrome.py => testing/marionette/harness/marionette_harness/tests/unit/test_title_chrome.py
extra : rebase_source : 5fdf57e8e7da11eb2f18430baa04f97f40fc1be1
2017-03-29 18:15:20 +01:00
Henrik Skupin a2c0ca9887 Bug 1291320 - Refactor navigation unit tests by using non-remote pages only if necessary. r=ato,automatedtester
Using non-remote pages causes framescripts to be reloaded. We should try
to avoid using those pages as much as possible, and test remoteness
switches in particular tests only. This is to reduce possible hangs.

MozReview-Commit-ID: ICPPkU07KQK

--HG--
extra : rebase_source : 7fdf1f2815790c70f4961cb004a3c066d9a2471e
2017-03-14 08:30:32 +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 44d092b5f4 Bug 1348872 - Marionette unit tests should test real modal dialogs. r=ato
Until now the unit tests only covered modal dialogs as shown when
disabling the preference `prompts.tab_modal.enabled`. This actually
tests an unsupported feature. Replacing it with a real modal dialog
like HTTP authentication is what we really want here.

MozReview-Commit-ID: 9FBxVuGJiEB

--HG--
rename : testing/marionette/harness/marionette_harness/www/modal_dialogs.html => testing/marionette/harness/marionette_harness/www/test_tab_modal_dialogs.html
extra : rebase_source : 504cf50ab5392d1f55e3027883ef6d45b69fc38b
2017-03-28 22:23:24 +02:00
Sebastian Hengst f42b8eb770 Backed out changeset 0faaff778221 (bug 1291320) for frequently failing test_navigation.py TestNavigate.test_focus_after_navigation. r=backout 2017-03-29 00:31:42 +02:00
Sebastian Hengst 2fd692d1a3 Backed out changeset 98267962a9a7 (bug 1291320) 2017-03-29 00:31:00 +02:00
Sebastian Hengst 808ec675be Backed out changeset cf7d24fe5cec (bug 1291320) 2017-03-29 00:30:56 +02:00
Sebastian Hengst 9313f64ed7 Backed out changeset dba85e8288af (bug 1291320) 2017-03-29 00:30:51 +02:00
Henrik Skupin 66f4253300 Bug 1291320 - Make refresh command synchronous. r=ato,automatedtester
Update the refresh command to make it synchronous, and let it return
once the target page has been loaded. This can be accomplished by using
the loadListener object in listener.js.

MozReview-Commit-ID: Lc8QoGFeQrY

--HG--
extra : rebase_source : afb2bd3f10fd08b6eff85f7583d2cbb535f4f154
2017-03-27 16:16:36 +02:00
Henrik Skupin 51a98f5c1b Bug 1291320 - Refactor page load algorithm for listener framescript. r=ato,automatedtester
This refactoring allows us to re-use the same load algorithm for
each command which could trigger a page load. It also takes remoteness
changes into account, and waits until the load has been done.

With this change we no longer check for readyState only, but observe
the necessary DOM events as fired for page unloads and loads. This will
help us to implement the page loading strategy later.

By observing the DOM events, I also expect a small increase of performance
for any kind of page load, given that we now return immediately and do not
have a delay of 100ms at maximum.

MozReview-Commit-ID: IVtO6KgJFES

--HG--
extra : rebase_source : 1216be48a23f8841fe1b12873e6154480ace125a
2017-03-28 21:41:38 +02:00
Henrik Skupin 198c6a3286 Bug 1291320 - Disallow slow loading page to be put into the cache. r=ato,automatedtester
To delay the page load for our slowly served example page when using the
back or forward commands, the page doesn't have to be put into the browser
cache.

MozReview-Commit-ID: 4xMjR3SakZn

--HG--
extra : rebase_source : 081ce5fa2b915c8aede55c7194e975da2ba6169e
2017-03-15 14:28:21 +01:00
Henrik Skupin 96adc8246a Bug 1291320 - Refactor navigation unit tests by using non-remote pages only if necessary. r=ato,automatedtester
Using non-remote pages causes framescripts to be reloaded. We should try
to avoid using those pages as much as possible, and test remoteness
switches in particular tests only. This is to reduce possible hangs.

MozReview-Commit-ID: ICPPkU07KQK

--HG--
extra : rebase_source : 05ec5d09fec88236b6535e757ee1d1348f485bf6
2017-03-14 08:30:32 +01:00
Wes Kocher 914dd4b76c Merge inbound to m-c a=merge 2017-03-28 13:30:56 -07: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
Geoff Brown e40c777f48 Bug 1334035 - Skip Marionette test_window_set_timeout_is_not_cancelled on Android; r=me,test-only 2017-03-28 08:15:13 -06: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 9bfbf4c96b Bug 1337743 - Return cause of quit; r=whimboo
This adds a return type to the quitApplication command in Marionette,
which extracts the data received by the quit-application observer.
The returned cause is either "shutdown" or "restart".

MozReview-Commit-ID: 85fBGaS1VeQ

--HG--
extra : rebase_source : f96409b772a2c30e755b5a28b6e4eef1dcfb2654
2017-03-27 12:49:22 +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
Carsten "Tomcat" Book 8eb7de1e22 Backed out changeset 5573ab27d696 (bug 1291320) for timeouts in navigation.py 2017-03-27 12:02:17 +02:00
Carsten "Tomcat" Book feae08e3c0 Backed out changeset e99f058812bf (bug 1291320) 2017-03-27 12:01:52 +02:00
Carsten "Tomcat" Book b74a02d6b7 Backed out changeset 3f619577e5d7 (bug 1291320) 2017-03-27 12:01:49 +02:00
Carsten "Tomcat" Book 9b4bc03f6b Backed out changeset 8580c2a3629e (bug 1291320) 2017-03-27 12:01:47 +02:00
Henrik Skupin c64b04d4ae Bug 1291320 - Make refresh command synchronous. r=ato,automatedtester
Update the refresh command to make it synchronous, and let it return
once the target page has been loaded. This can be accomplished by using
the loadListener object in listener.js.

MozReview-Commit-ID: Lc8QoGFeQrY

--HG--
extra : rebase_source : f5aa7a9a6d144b849b2808b08d78ca99fc83e518
2017-03-14 18:10:00 +01:00
Henrik Skupin 6df67da555 Bug 1291320 - Refactor page load algorithm for listener framescript. r=ato,automatedtester
This refactoring allows us to re-use the same load algorithm for
each command which could trigger a page load. It also takes remoteness
changes into account, and waits until the load has been done.

With this change we no longer check for readyState only, but observe
the necessary DOM events as fired for page unloads and loads. This will
help us to implement the page loading strategy later.

By observing the DOM events, I also expect a small increase of performance
for any kind of page load, given that we now return immediately and do not
have a delay of 100ms at maximum.

MozReview-Commit-ID: IVtO6KgJFES

--HG--
extra : rebase_source : 7cce694d464a18773c65056c336b9f900f5466d0
2017-03-23 21:54:02 +01:00
Henrik Skupin a87e271b79 Bug 1291320 - Disallow slow loading page to be put into the cache. r=ato,automatedtester
To delay the page load for our slowly served example page when using the
back or forward commands, the page doesn't have to be put into the browser
cache.

MozReview-Commit-ID: 4xMjR3SakZn

--HG--
extra : rebase_source : a580578b277ad56a54a775f5a9a18ec62c7f81a7
2017-03-15 14:28:21 +01:00
Henrik Skupin 80eb20250e Bug 1291320 - Refactor navigation unit tests by using non-remote pages only if necessary. r=ato,automatedtester
Using non-remote pages causes framescripts to be reloaded. We should try
to avoid using those pages as much as possible, and test remoteness
switches in particular tests only. This is to reduce possible hangs.

MozReview-Commit-ID: ICPPkU07KQK

--HG--
extra : rebase_source : 54faf68950fe70bbb49bd8f6b4f8595d5ef988c0
2017-03-14 08:30:32 +01:00
Andreas Tolfsen 94a0c13a31 Bug 1342162 - Align pageLoad key with WebDriver; r=maja_zf
The WebDriver specification recently decided to use "pageLoad" instead of
"page load" to identify the page load duration timeout in the session
timeouts configuration object:

	https://github.com/w3c/webdriver/pull/796

This change aligns Marionette with WebDriver, and as long as this patch
is uplifted to Aurora (53) and Beta (52) in reasonable time, we should be
able to avoid the backwards compatibility dance with the Python client
(for upgrade tests) because the original change to the data format
landed on the current Firefox version:

	https://bugzilla.mozilla.org/show_bug.cgi?id=1316622

MozReview-Commit-ID: BzQeJku4AFS

--HG--
extra : rebase_source : 61b4450ef610cb36e6ed585ee6b20807b51f23be
2017-02-23 18:33:26 +00:00
Sebastian Hengst f65c241343 Backed out changeset db38ad37d57c (bug 1291320) for failing xpcshell test testing/marionette/test_navigate.js. r=backout 2017-03-23 21:49:12 +01:00