Bug 945734 - Correct argument error in GeckoDriver#setScreenOrientation; r?automatedtester draft
authorAndreas Tolfsen <ato@mozilla.com>
Tue, 10 May 2016 14:31:04 +0100
changeset 365714 2c0c8380eafdfa3579129d611f913ec798bdb221
parent 365494 674a552743785c28c75866969aad513bd8eaf6ae
child 520641 9976fc4ccd6325f854b57caf33b31d253af538cc
push id17834
push userbmo:ato@mozilla.com
push dateWed, 11 May 2016 11:04:10 +0000
reviewersautomatedtester
bugs945734
milestone49.0a1
Bug 945734 - Correct argument error in GeckoDriver#setScreenOrientation; r?automatedtester MozReview-Commit-ID: 4G2GyeFJBJP
testing/marionette/driver.js
--- a/testing/marionette/driver.js
+++ b/testing/marionette/driver.js
@@ -2403,17 +2403,17 @@ GeckoDriver.prototype.setScreenOrientati
     "portrait", "landscape",
     "portrait-primary", "landscape-primary",
     "portrait-secondary", "landscape-secondary"
   ];
 
   let or = String(cmd.parameters.orientation);
   let mozOr = or.toLowerCase();
   if (ors.indexOf(mozOr) < 0) {
-    throw new WebDriverError(`Unknown screen orientation: ${or}`);
+    throw new InvalidArgumentError(`Unknown screen orientation: ${or}`);
   }
 
   let win = this.getCurrentWindow();
   if (!win.screen.mozLockOrientation(mozOr)) {
     throw new WebDriverError(`Unable to set screen orientation: ${or}`);
   }
 };