Bug 1441226 - Rename NoAlertOpenError to NoSuchAlertError. r=whimboo
☠☠ backed out by 0ca3c363d6cc ☠ ☠
authorAndreas Tolfsen <ato@sny.no>
Mon, 26 Feb 2018 17:35:30 +0000
changeset 405943 fbe5a80f2f5b2a7235fd17ba296c66b38846efeb
parent 405942 672e7d5d8f40a04ccd87b0f84eb4ade0f19cbdd4
child 405944 f57a1cd84e0c347e26d11e683f790df8387ddbdb
push id60417
push useratolfsen@mozilla.com
push dateThu, 01 Mar 2018 14:31:23 +0000
treeherderautoland@fbe5a80f2f5b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerswhimboo
bugs1441226
milestone60.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1441226 - Rename NoAlertOpenError to NoSuchAlertError. r=whimboo To match the WebDriver specification error code names, this patch renames the NoAlertOpenError type to NoSuchAlertError. Its string error code (the status property) is still correct. MozReview-Commit-ID: DhWz1tn6DsT
testing/marionette/driver.js
testing/marionette/error.js
testing/marionette/test_error.js
--- a/testing/marionette/driver.js
+++ b/testing/marionette/driver.js
@@ -27,17 +27,17 @@ const {
   element,
   WebElement,
 } = ChromeUtils.import("chrome://marionette/content/element.js", {});
 const {
   InsecureCertificateError,
   InvalidArgumentError,
   InvalidCookieDomainError,
   InvalidSelectorError,
-  NoAlertOpenError,
+  NoSuchAlertError,
   NoSuchFrameError,
   NoSuchWindowError,
   SessionNotCreatedError,
   UnknownError,
   UnsupportedOperationError,
   WebDriverError,
 } = ChromeUtils.import("chrome://marionette/content/error.js", {});
 ChromeUtils.import("chrome://marionette/content/evaluate.js");
@@ -3157,17 +3157,17 @@ GeckoDriver.prototype.sendKeysToDialog =
   // see toolkit/components/prompts/content/commonDialog.js
   let {loginTextbox} = this.dialog.ui;
   await interaction.sendKeysToElement(
       loginTextbox, cmd.parameters.text, this.a11yChecks);
 };
 
 GeckoDriver.prototype._checkIfAlertIsPresent = function() {
   if (!this.dialog || !this.dialog.ui) {
-    throw new NoAlertOpenError("No modal dialog is currently open");
+    throw new NoSuchAlertError("No modal dialog is currently open");
   }
 };
 
 GeckoDriver.prototype._assertAndDismissModal = function() {
   try {
     assert.noUserPrompt(this.dialog);
   } catch (e) {
     this.dismissDialog();
--- a/testing/marionette/error.js
+++ b/testing/marionette/error.js
@@ -13,17 +13,17 @@ const ERRORS = new Set([
   "InsecureCertificateError",
   "InvalidArgumentError",
   "InvalidCookieDomainError",
   "InvalidElementStateError",
   "InvalidSelectorError",
   "InvalidSessionIDError",
   "JavaScriptError",
   "MoveTargetOutOfBoundsError",
-  "NoAlertOpenError",
+  "NoSuchAlertError",
   "NoSuchElementError",
   "NoSuchFrameError",
   "NoSuchWindowError",
   "ScriptTimeoutError",
   "SessionNotCreatedError",
   "StaleElementReferenceError",
   "TimeoutError",
   "UnableToSetCookieError",
@@ -413,17 +413,17 @@ class MoveTargetOutOfBoundsError extends
     this.status = "move target out of bounds";
   }
 }
 
 /**
  * An attempt was made to operate on a modal dialog when one was
  * not open.
  */
-class NoAlertOpenError extends WebDriverError {
+class NoSuchAlertError extends WebDriverError {
   constructor(message) {
     super(message);
     this.status = "no such alert";
   }
 }
 
 /**
  * An element could not be located on the page using the given
@@ -549,17 +549,17 @@ const STATUSES = new Map([
   ["insecure certificate", InsecureCertificateError],
   ["invalid argument", InvalidArgumentError],
   ["invalid cookie domain", InvalidCookieDomainError],
   ["invalid element state", InvalidElementStateError],
   ["invalid selector", InvalidSelectorError],
   ["invalid session id", InvalidSessionIDError],
   ["javascript error", JavaScriptError],
   ["move target out of bounds", MoveTargetOutOfBoundsError],
-  ["no alert open", NoAlertOpenError],
+  ["no such alert", NoSuchAlertError],
   ["no such element", NoSuchElementError],
   ["no such frame", NoSuchFrameError],
   ["no such window", NoSuchWindowError],
   ["script timeout", ScriptTimeoutError],
   ["session not created", SessionNotCreatedError],
   ["stale element reference", StaleElementReferenceError],
   ["timeout", TimeoutError],
   ["unable to set cookie", UnableToSetCookieError],
--- a/testing/marionette/test_error.js
+++ b/testing/marionette/test_error.js
@@ -10,17 +10,17 @@ const {
   InsecureCertificateError,
   InvalidArgumentError,
   InvalidCookieDomainError,
   InvalidElementStateError,
   InvalidSelectorError,
   InvalidSessionIDError,
   JavaScriptError,
   MoveTargetOutOfBoundsError,
-  NoAlertOpenError,
+  NoSuchAlertError,
   NoSuchElementError,
   NoSuchFrameError,
   NoSuchWindowError,
   ScriptTimeoutError,
   SessionNotCreatedError,
   stack,
   StaleElementReferenceError,
   TimeoutError,
@@ -328,19 +328,19 @@ add_test(function test_JavaScriptError()
   equal("funcname @file, line line",
       new JavaScriptError("message", {fnName: "funcname", file: "file", line: "line"}).stack);
 
   // TODO(ato): More exhaustive tests for JS stack computation
 
   run_next_test();
 });
 
-add_test(function test_NoAlertOpenError() {
-  let err = new NoAlertOpenError("foo");
-  equal("NoAlertOpenError", err.name);
+add_test(function test_NoSuchAlertError() {
+  let err = new NoSuchAlertError("foo");
+  equal("NoSuchAlertError", err.name);
   equal("foo", err.message);
   equal("no such alert", err.status);
   ok(err instanceof WebDriverError);
 
   run_next_test();
 });
 
 add_test(function test_NoSuchElementError() {