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
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
Previously, mock_runner.driverclass() returned a plain Mock object.
MozReview-Commit-ID: 1RMQhud4BJD
--HG--
extra : rebase_source : 54d7f62444e66bc2f9ae07c0b5ed91cd9a3cbbaf
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
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
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
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
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
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
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
Removes the Marionette.import_script API as it is not used by any
consumers of the client, including the Firefox UI tests.
MozReview-Commit-ID: 3xceYXZZVR0
--HG--
extra : rebase_source : 7422704737da599704125874a6f52e4eeb670dfd
The import script functionality was removed in
https://bugzilla.mozilla.org/show_bug.cgi?id=1368648, but the
Marionette.clear_imported_script API was not removed from the client.
We are currently making calls after every test to the clearImportedScripts
command in the server, but we are apparently ignoring the ‘unknown
command’ error that is being returned.
MozReview-Commit-ID: KVjh2IfhuUY
--HG--
extra : rebase_source : ebc8faf8746e7e3e91b395ec488aeea014747848
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
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
When synthesizing a MouseEvent for the performActions command,
set shiftKey, ctrlKey, etc., based on inputStateMap.
MozReview-Commit-ID: Knw3gxuAcSB
--HG--
extra : source : afcfa17be8acdd3d1b88b2bf8d6deffb53c52af1
The Permissions API was used extensively during B2G to make sure the
state of the browser and permissions for APIs were in the relevant
state. This code is no longer used and can be removed.
MozReview-Commit-ID: HgcQe3GEd09
--HG--
extra : rebase_source : 08187e93b6729faae8a1913573d57add752dbb46
setTestName was used for logging which test was being run for the
JS Tests used in B2G.
MozReview-Commit-ID: FNF4Sm7vAYM
--HG--
extra : rebase_source : cbb6667bb0d8be65c34c6e84b70caf21c6b3c34d
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
When synthesizing a MouseEvent for the performActions command,
set shiftKey, ctrlKey, etc., based on inputStateMap.
MozReview-Commit-ID: Knw3gxuAcSB
--HG--
extra : rebase_source : 499f6987fbc237662c925c7fedc83611e4de148b
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.
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
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
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
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
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
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
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
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
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