Bug 1392368 - Test no-op input for Set Window Rect. r?automatedtester draft
authorAndreas Tolfsen <ato@sny.no>
Tue, 22 Aug 2017 15:17:50 +0100
changeset 653180 7316875b6b2a427144e4a5db3da6f07e9fb68d0e
parent 653179 6c6b6ace9e08b25b99984e7df55de2317fa854a2
child 653181 473efc4f6974e3902ff1fafc3454098b4249abc8
push id76248
push userbmo:ato@sny.no
push dateFri, 25 Aug 2017 16:27:14 +0000
reviewersautomatedtester
bugs1392368
milestone57.0a1
Bug 1392368 - Test no-op input for Set Window Rect. r?automatedtester MozReview-Commit-ID: HfvqHtvDUha
testing/web-platform/tests/webdriver/tests/set_window_rect.py
--- a/testing/web-platform/tests/webdriver/tests/set_window_rect.py
+++ b/testing/web-platform/tests/webdriver/tests/set_window_rect.py
@@ -226,16 +226,62 @@ def test_x_y_floats(session):
     assert value["y"] == 400
 
     response = set_window_rect(session, {"x": 300, "y": 450.5})
     value = assert_success(response)
     assert value["x"] == 300
     assert value["y"] == 450.5
 
 
+@pytest.mark.parametrize("rect", [
+    {},
+
+    {"width": None},
+    {"height": None},
+    {"width": None, "height": None},
+
+    {"x": None},
+    {"y": None},
+    {"x": None, "y": None},
+
+    {"width": None, "x": None},
+    {"width": None, "y": None},
+    {"height": None, "x": None},
+    {"height": None, "Y": None},
+
+    {"width": None, "height": None, "x": None, "y": None},
+
+    {"width": 200},
+    {"height": 200},
+    {"x": 200},
+    {"y": 200},
+    {"width": 200, "x": 200},
+    {"height": 200, "x": 200},
+    {"width": 200, "y": 200},
+    {"height": 200, "y": 200},
+])
+def test_no_change(session, rect):
+    """
+    13. If width and height are not null:
+
+    [...]
+
+    14. If x and y are not null:
+
+    [...]
+
+    15. Return success with the JSON serialization of the current
+    top-level browsing context's window rect.
+    """
+
+    original = session.window.rect
+    response = set_window_rect(session, rect)
+    assert_success(response, original)
+
+
     original = session.window.rect
 
 
 def test_fully_exit_fullscreen(session):
     """
     10. Fully exit fullscreen.
 
     [...]