Bug 1439995 - Add user prompt checks for script execution commands. r?automatedtester
WebDriver:{ExecuteScript,ExecuteAsyncScript} were missing user
prompt checks. This patch does not add any tests because Marionette
does not yet implement the user prompt handler as described in
the specification, which means that the relevant tests in WPT are
incorrect for this behaviour.
MozReview-Commit-ID: BRTAm1ptsQw
--- a/testing/marionette/driver.js
+++ b/testing/marionette/driver.js
@@ -868,16 +868,17 @@ GeckoDriver.prototype.getContext = funct
* @throws {ScriptTimeoutError}
* If the script was interrupted due to reaching the
* <var>scriptTimeout</var> or default timeout.
* @throws {JavaScriptError}
* If an {@link Error} was thrown whilst evaluating the script.
*/
GeckoDriver.prototype.executeScript = async function(cmd, resp) {
assert.open(this.getCurrentWindow());
+ this._assertAndDismissModal();
let {script, args, scriptTimeout} = cmd.parameters;
scriptTimeout = scriptTimeout || this.timeouts.script;
let opts = {
sandboxName: cmd.parameters.sandbox,
newSandbox: !!(typeof cmd.parameters.newSandbox == "undefined") ||
cmd.parameters.newSandbox,
@@ -945,16 +946,17 @@ GeckoDriver.prototype.executeScript = as
* @throws {ScriptTimeoutError}
* If the script was interrupted due to reaching the
* <var>scriptTimeout</var> or default timeout.
* @throws {JavaScriptError}
* If an Error was thrown whilst evaluating the script.
*/
GeckoDriver.prototype.executeAsyncScript = async function(cmd, resp) {
assert.open(this.getCurrentWindow());
+ this._assertAndDismissModal();
let {script, args, scriptTimeout} = cmd.parameters;
scriptTimeout = scriptTimeout || this.timeouts.script;
let opts = {
sandboxName: cmd.parameters.sandbox,
newSandbox: !!(typeof cmd.parameters.newSandbox == "undefined") ||
cmd.parameters.newSandbox,