Bug 1319237 - Improve window position test assertions; r=maja_zf
☠☠ backed out by 4f4dcc23d36b ☠ ☠
authorAndreas Tolfsen <ato@mozilla.com>
Thu, 02 Feb 2017 14:57:19 +0000
changeset 341016 f8449c471b8fbe6518063072e0de193f06af6229
parent 341015 f2bdf078f39a113f9c97b8180e6984d262129b11
child 341017 4dc796bbcfaa497154f21abe3f501933a64392db
push id86615
push userkwierso@gmail.com
push dateTue, 07 Feb 2017 01:52:08 +0000
treeherdermozilla-inbound@f0453084d86e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmaja_zf
bugs1319237
milestone54.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 1319237 - Improve window position test assertions; r=maja_zf MozReview-Commit-ID: qmFS0JEqx3
testing/marionette/harness/marionette_harness/tests/unit/test_window_position.py
--- a/testing/marionette/harness/marionette_harness/tests/unit/test_window_position.py
+++ b/testing/marionette/harness/marionette_harness/tests/unit/test_window_position.py
@@ -5,28 +5,29 @@
 from marionette_driver.errors import InvalidArgumentException
 
 from marionette_harness import MarionetteTestCase
 
 
 class TestWindowPosition(MarionetteTestCase):
     def test_get_types(self):
         position = self.marionette.get_window_position()
-        self.assertTrue(isinstance(position["x"], int))
-        self.assertTrue(isinstance(position["y"], int))
+        self.assertIsInstance(position["x"], int)
+        self.assertIsInstance(position["y"], int)
 
     def test_set_types(self):
         for x, y in (["a", "b"], [1.2, 3.4], [True, False], [[], []], [{}, {}]):
+            print("testing invalid type position ({},{})".format(x, y))
             with self.assertRaises(InvalidArgumentException):
                 self.marionette.set_window_position(x, y)
 
     def test_out_of_bounds_arguments(self):
-        with self.assertRaises(InvalidArgumentException):
-            self.marionette.set_window_position(-1, 0)
-        with self.assertRaises(InvalidArgumentException):
-            self.marionette.set_window_position(0, -1)
+        for x, y in [(-1,0), (0,-1), (-1,-1)]:
+            print("testing out of bounds position ({},{})".format(x, y))
+            with self.assertRaises(InvalidArgumentException):
+                self.marionette.set_window_position(x, y)
 
-    def test_move(self):
+    def test_move_to_new_position(self):
         old_position = self.marionette.get_window_position()
         new_position = {"x": old_position["x"] + 10, "y": old_position["y"] + 10}
         self.marionette.set_window_position(new_position["x"], new_position["y"])
-        self.assertNotEqual(old_position['x'], new_position["x"])
-        self.assertNotEqual(old_position['y'], new_position["y"])
+        self.assertNotEqual(old_position["x"], new_position["x"])
+        self.assertNotEqual(old_position["y"], new_position["y"])