Bug 1280101 - Remove check for window sizes larger than screen; r=automatedtester
authorAndreas Tolfsen <ato@mozilla.com>
Tue, 14 Jun 2016 18:58:15 +0100
changeset 302157 333518a265a209bec3a25ef6caeb993292439878
parent 302156 eca2ce2b6dd2d80969bf0d8e55593db4a37cddc8
child 302158 1c0c5bcadebdd5a65b395637312ac7f4b9935343
push id30353
push userkwierso@gmail.com
push dateTue, 21 Jun 2016 17:06:01 +0000
treeherdermozilla-central@20167cee53dc [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersautomatedtester
bugs1280101
milestone50.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 1280101 - Remove check for window sizes larger than screen; r=automatedtester MozReview-Commit-ID: K2l0pPfGbGp
testing/marionette/driver.js
testing/marionette/harness/marionette/tests/unit/test_set_window_size.py
--- a/testing/marionette/driver.js
+++ b/testing/marionette/driver.js
@@ -2485,33 +2485,24 @@ GeckoDriver.prototype.getWindowSize = fu
 };
 
 /**
  * Set the size of the browser window currently in focus.
  *
  * 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();
   }
 
-  let width = cmd.parameters.width;
-  let height = cmd.parameters.height;
-
+  let {width, height} = cmd.parameters;
   let win = this.getCurrentWindow();
-  if (width >= win.screen.availWidth || height >= win.screen.availHeight) {
-    throw new UnsupportedOperationError("Requested size exceeds screen size")
-  }
-
   win.resizeTo(width, height);
 };
 
 /**
  * Maximizes the user agent window as if the user pressed the maximise
  * button.
  *
  * Not Supported on B2G or Fennec.
--- a/testing/marionette/harness/marionette/tests/unit/test_set_window_size.py
+++ b/testing/marionette/harness/marionette/tests/unit/test_set_window_size.py
@@ -38,27 +38,23 @@ class TestSetWindowSize(MarionetteTestCa
         self.marionette.set_window_size(width, height)
         self.wait_for_condition(lambda m: m.execute_script("return window.wrappedJSObject.rcvd_event;"))
         size = self.marionette.window_size
         self.assertEqual(size['width'], width,
                          "Window width is %s but should be %s" % (size['width'], width))
         self.assertEqual(size['height'], height,
                          "Window height is %s but should be %s" % (size['height'], height))
 
-    def test_that_we_throw_an_error_when_trying_to_set_maximum_size(self):
-        # valid size
-        width = self.max_width - 100
-        height = self.max_height - 100
-        self.marionette.set_window_size(width, height)
-        # invalid size (cannot maximize)
-        with self.assertRaisesRegexp(UnsupportedOperationException, "Requested size exceeds screen size"):
-            self.marionette.set_window_size(self.max_width, self.max_height)
+    def test_possible_to_request_window_larger_than_screen(self):
+        self.marionette.set_window_size(100000, 100000)
         size = self.marionette.window_size
-        self.assertEqual(size['width'], width, "Window width should not have changed")
-        self.assertEqual(size['height'], height, "Window height should not have changed")
+
+        # In X the window size may be greater than the bounds of the screen
+        self.assertGreaterEqual(size["width"], self.max_width)
+        self.assertGreaterEqual(size["height"], self.max_height)
 
     def test_that_we_can_maximise_the_window(self):
         # valid size
         width = self.max_width - 100
         height = self.max_height - 100
         self.marionette.set_window_size(width, height)
 
         # event handler