--- a/testing/marionette/harness/marionette_harness/tests/unit/test_window_maximize.py
+++ b/testing/marionette/harness/marionette_harness/tests/unit/test_window_maximize.py
@@ -33,24 +33,25 @@ class TestWindowMaximize(MarionetteTestC
def assert_window_maximized(self, actual, delta=None):
if self.marionette.session_capabilities["platformName"] == "windows_nt":
delta = 16
else:
delta = 8
self.assertGreater(
actual["width"], self.max["width"] - delta,
- msg="Window width is not within {} px of availWidth: "
- "current width {} and max width {}"
- .format(delta, actual["width"], self.max["width"] - delta))
- self.assertGreater(
+ msg="Window width is not within {delta} px of availWidth: "
+ "current width {expected} should be greater than max width {max}"
+ .format(delta=delta, expected=actual["width"], max=self.max["width"] - delta))
+ self.assertAlmostEqual(
actual["height"], self.max["height"],
+ delta=delta,
msg="Window height is not within {} px of availHeight, "
"current height {} and max height {}"
- .format(delta, actual["height"], self.max["height"] - delta))
+ .format(delta, actual["height"], self.max["height"]))
def assert_window_restored(self, actual):
self.assertEqual(self.original_size["width"], actual["width"])
self.assertEqual(self.original_size["height"], actual["height"])
def assert_window_rect(self, rect):
self.assertIn("width", rect)
self.assertIn("height", rect)
--- a/testing/marionette/harness/marionette_harness/tests/unit/test_window_rect.py
+++ b/testing/marionette/harness/marionette_harness/tests/unit/test_window_rect.py
@@ -116,18 +116,18 @@ class TestSize(MarionetteTestCase):
# WebDriver spec says a resize cannot result in window being
# maximised, an error is returned if that is the case; therefore if
# the window is maximised at the start of this test, returning to
# the original size via set_window_size size will result in error;
# so reset to original size minus 1 pixel width
start_size = self.marionette.window_size
if start_size["width"] == self.max["width"] and start_size["height"] == self.max["height"]:
- start_size["width"] -= 1
- start_size["height"] -= 1
+ start_size["width"] -= 10
+ start_size["height"] -= 10
self.marionette.set_window_size(start_size["width"], start_size["height"])
self.original_size = self.marionette.window_size
def tearDown(self):
self.marionette.set_window_size(
self.original_size["width"], self.original_size["height"])
is_fullscreen = self.marionette.execute_script("return document.fullscreenElement;", sandbox=None)