Bug 1257526 - Harmonise unsupported operation error usage; r=automatedtester
authorAndreas Tolfsen <ato@mozilla.com>
Thu, 17 Mar 2016 14:57:46 +0000
changeset 290054 0d344473d50fd8ead38d679e37c70adc449f200a
parent 290053 66fd82b72d1e2b584e50b3200dff2f08f4ed88c0
child 290055 11ee5f2e12152c3f984dc3c8153b31693035f41b
push id30114
push usercbook@mozilla.com
push dateThu, 24 Mar 2016 15:15:54 +0000
treeherdermozilla-central@24c5fbde4488 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersautomatedtester
bugs1257526
milestone48.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 1257526 - Harmonise unsupported operation error usage; r=automatedtester Throw unsupported operation errors the same way throughout Marionette. MozReview-Commit-ID: D63gVIeX2qK
testing/marionette/driver.js
--- a/testing/marionette/driver.js
+++ b/testing/marionette/driver.js
@@ -2642,18 +2642,18 @@ GeckoDriver.prototype.getWindowSize = fu
  * Not supported on B2G. The supplied width and height values refer to
  * the window outerWidth and outerHeight values, which include scroll
  * bars, title bars, etc.
  *
  * An error will be returned if the requested window size would result
  * in the window being in the maximized state.
  */
 GeckoDriver.prototype.setWindowSize = function(cmd, resp) {
-  if (this.appName !== "Firefox") {
-    throw new UnsupportedOperationError("Not supported on mobile");
+  if (this.appName != "Firefox") {
+    throw new UnsupportedOperationError();
   }
 
   let width = parseInt(cmd.parameters.width);
   let height = parseInt(cmd.parameters.height);
 
   let win = this.getCurrentWindow();
   if (width >= win.screen.availWidth && height >= win.screen.availHeight) {
     throw new UnsupportedOperationError("Invalid requested size, cannot maximize");
@@ -2665,17 +2665,17 @@ GeckoDriver.prototype.setWindowSize = fu
 /**
  * Maximizes the user agent window as if the user pressed the maximise
  * button.
  *
  * Not Supported on B2G or Fennec.
  */
 GeckoDriver.prototype.maximizeWindow = function(cmd, resp) {
   if (this.appName != "Firefox") {
-    throw new UnsupportedOperationError("Not supported for mobile");
+    throw new UnsupportedOperationError();
   }
 
   let win = this.getCurrentWindow();
   win.moveTo(0,0);
   win.resizeTo(win.screen.availWidth, win.screen.availHeight);
 };
 
 /**