Bug 1381876 - Fix window maximised assertions. r?automatedtester
The "delta" in the second assertion was not deducted from the height.
The patch also improves the error message.
MozReview-Commit-ID: 8u8UhKg3Q62
--- a/testing/marionette/harness/marionette_harness/tests/unit/test_window_maximize.py
+++ b/testing/marionette/harness/marionette_harness/tests/unit/test_window_maximize.py
@@ -34,23 +34,23 @@ class TestWindowMaximize(MarionetteTestC
if self.marionette.session_capabilities["platformName"] == "windows_nt":
delta = 16
else:
delta = 8
self.assertGreaterEqual(
actual["width"], self.max["width"] - delta,
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))
+ "current width {current} should be greater than or equal to max width {max}"
+ .format(delta=delta, current=actual["width"], max=self.max["width"] - delta))
self.assertGreaterEqual(
- actual["height"], self.max["height"],
+ actual["height"], self.max["height"] - delta,
msg="Window height is not within {delta} px of availHeight: "
- "current height {expected} should be greater than max width {max}"
- .format(delta=delta, expected=actual["height"], max=self.max["height"] - delta))
+ "current height {current} should be greater than or equal to max height {max}"
+ .format(delta=delta, current=actual["height"], max=self.max["height"] - delta))
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)