Bug 1381876 - Fix window maximised assertions. r?automatedtester draft
authorAndreas Tolfsen <ato@sny.no>
Tue, 01 Aug 2017 18:19:34 +0100
changeset 641117 80f5c682e43dd854192fab3d494b129f31439c40
parent 641116 66db374659c9b940e5d86214206e69cca1b52d43
child 641118 0a29b248a18040afcf375d27572abead12fd93e5
push id72440
push userbmo:ato@sny.no
push dateSat, 05 Aug 2017 16:47:34 +0000
reviewersautomatedtester
bugs1381876
milestone57.0a1
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
testing/marionette/harness/marionette_harness/tests/unit/test_window_maximize.py
--- 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)