Bug 1449780 [wpt PR 10226] - WebDriver: add more WebKit workarounds to detect whether a window is fullscreen, a=testonly
authorBrian Burg <burg@users.noreply.github.com>
Mon, 09 Apr 2018 18:26:56 +0000
changeset 467215 eda85938b492be300093ab3c1dbe98fde78d2bfc
parent 467214 f33779c9c5725285f27d1a3c4ce565b4392b1768
child 467216 e44e57545797d584b5d6bc4f634ac2ba59fa4241
push id9165
push userasasaki@mozilla.com
push dateThu, 26 Apr 2018 21:04:54 +0000
treeherdermozilla-beta@064c3804de2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1449780, 10226
milestone61.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 1449780 [wpt PR 10226] - WebDriver: add more WebKit workarounds to detect whether a window is fullscreen, a=testonly Automatic update from web-platform-testswebdriver: add more WebKit workarounds to detect whether a window is fullscreen (#10226) WebKit doesn't implement the Fullscreen API yet, so we need to use the vendor prefixed property to check whether the window is fullscreen. This workaround was previously applied to fullscreen_window.py, but it needs to happen in other places as wel. wpt-commits: 592e2ed83ecd717392d37047536250ba74f1bafa wpt-pr: 10226 wpt-commits: 592e2ed83ecd717392d37047536250ba74f1bafa wpt-pr: 10226
testing/web-platform/meta/MANIFEST.json
testing/web-platform/tests/webdriver/tests/contexts/maximize_window.py
testing/web-platform/tests/webdriver/tests/fullscreen_window.py
testing/web-platform/tests/webdriver/tests/minimize_window.py
testing/web-platform/tests/webdriver/tests/set_window_rect.py
--- a/testing/web-platform/meta/MANIFEST.json
+++ b/testing/web-platform/meta/MANIFEST.json
@@ -603539,17 +603539,17 @@
    "c812269d034c9ca1b8c4f136dd5d0cea52f4d0f0",
    "support"
   ],
   "webdriver/tests/contexts/json_serialize_windowproxy.py": [
    "d29c82c48b3bd1e2b07c40798a774eb77d6178a5",
    "wdspec"
   ],
   "webdriver/tests/contexts/maximize_window.py": [
-   "7912e2f7ebdffe2598eb3b9a20f4fc7fce22447e",
+   "e0dfeb6234371077baa7f67a45d7ffa9b61c9759",
    "wdspec"
   ],
   "webdriver/tests/contexts/resizing_and_positioning.py": [
    "479379109115668183643e8a050396219332887d",
    "wdspec"
   ],
   "webdriver/tests/cookies/add_cookie.py": [
    "c87dc51111c10bbc29339ba0d1be85fb35ee6d6f",
@@ -603647,17 +603647,17 @@
    "9d8a28b94b8cdac88650b675cb00bf21261444e8",
    "wdspec"
   ],
   "webdriver/tests/execute_script/user_prompts.py": [
    "901487f8270dcce693867ca090393e093d26f22b",
    "wdspec"
   ],
   "webdriver/tests/fullscreen_window.py": [
-   "67cc7d992d81a176297038f5516c8a9c95018040",
+   "c244064c0595d9274ddef98c527d193355ba13fa",
    "wdspec"
   ],
   "webdriver/tests/get_window_rect.py": [
    "c9139c16aa950c734c776887d6a762b867790812",
    "wdspec"
   ],
   "webdriver/tests/interaction/element_clear.py": [
    "476fad0b4a5a38a9ac15ddeb1c26b0b18fd66e8c",
@@ -603667,17 +603667,17 @@
    "9c071e60e1203cf31120f20874b5f38ba41dacc3",
    "wdspec"
   ],
   "webdriver/tests/interface.html": [
    "f7b2c45ff8b1b5790dd390fbe2ab997766f5d9a8",
    "testharness"
   ],
   "webdriver/tests/minimize_window.py": [
-   "ac1df5462702ac368ffa92cc12cfb5e34df226ac",
+   "08d4414ce915f1ebe7825d5d99e204dc331fe155",
    "wdspec"
   ],
   "webdriver/tests/navigation/current_url.py": [
    "828e40301838c99aa2978733bbce3db3acc185a0",
    "wdspec"
   ],
   "webdriver/tests/navigation/get_title.py": [
    "2ee18932a8ae3c4190b37e2b28141a6af49cc507",
@@ -603723,17 +603723,17 @@
    "4bfb99fd4ba44ab5b4e70e9246cbb200c098ae89",
    "support"
   ],
   "webdriver/tests/sessions/status.py": [
    "75edf0e629d9cd494c63585408c76217ff953722",
    "wdspec"
   ],
   "webdriver/tests/set_window_rect.py": [
-   "8a124f80e6e7732a651a80da3f6cdf8e2ed99e3e",
+   "079038aa66cb729cf205aac040a5fe075d01fd8a",
    "wdspec"
   ],
   "webdriver/tests/state/__init__.py": [
    "da39a3ee5e6b4b0d3255bfef95601890afd80709",
    "support"
   ],
   "webdriver/tests/state/get_element_attribute.py": [
    "1fcd451313d40a0b0a84ced63596d032ffc97f2a",
--- a/testing/web-platform/tests/webdriver/tests/contexts/maximize_window.py
+++ b/testing/web-platform/tests/webdriver/tests/contexts/maximize_window.py
@@ -7,16 +7,22 @@ from tests.support.inline import inline
 
 alert_doc = inline("<script>window.alert()</script>")
 
 
 def maximize(session):
     return session.transport.send("POST", "session/%s/window/maximize" % session.session_id)
 
 
+def is_fullscreen(session):
+    # At the time of writing, WebKit does not conform to the Fullscreen API specification.
+    # Remove the prefixed fallback when https://bugs.webkit.org/show_bug.cgi?id=158125 is fixed.
+    return session.execute_script("return !!(window.fullScreen || document.webkitIsFullScreen)")
+
+
 # 10.7.3 Maximize Window
 
 
 def test_no_browsing_context(session, create_window):
     """
     2. If the current top-level browsing context is no longer open,
     return error with error code no such window.
 
@@ -132,21 +138,21 @@ def test_fully_exit_fullscreen(session):
 
       2. Unfullscreen elements whose fullscreen flag is set, within
       document's top layer, except for document's fullscreen element.
 
       3. Exit fullscreen document.
 
     """
     session.window.fullscreen()
-    assert session.execute_script("return window.fullScreen") is True
+    assert is_fullscreen(session) is True
 
     response = maximize(session)
     assert_success(response)
-    assert session.execute_script("return window.fullScreen") is False
+    assert is_fullscreen(session) is False
 
 
 def test_restore_the_window(session):
     """
     5. Restore the window.
 
     [...]
 
--- a/testing/web-platform/tests/webdriver/tests/fullscreen_window.py
+++ b/testing/web-platform/tests/webdriver/tests/fullscreen_window.py
@@ -11,16 +11,22 @@ alert_doc = inline("<script>window.alert
 def read_global(session, name):
     return session.execute_script("return %s;" % name)
 
 
 def fullscreen(session):
     return session.transport.send("POST", "session/%s/window/fullscreen" % session.session_id)
 
 
+def is_fullscreen(session):
+    # At the time of writing, WebKit does not conform to the Fullscreen API specification.
+    # Remove the prefixed fallback when https://bugs.webkit.org/show_bug.cgi?id=158125 is fixed.
+    return session.execute_script("return !!(window.fullScreen || document.webkitIsFullScreen)")
+
+
 # 10.7.5 Fullscreen Window
 
 
 def test_no_browsing_context(session, create_window):
     """
     1. If the current top-level browsing context is no longer open,
     return error with error code no such window.
 
@@ -130,21 +136,16 @@ def test_handle_prompt_missing_value(ses
 
     response = fullscreen(session)
 
     assert_error(response, "unexpected alert open")
     assert_dialog_handled(session, "dismiss #3")
     assert read_global(session, "dismiss3") == None
 
 
-def is_fullscreen(session):
-    # At the time of writing, WebKit does not conform to the Fullscreen API specification.
-    # Remove the prefixed fallback when https://bugs.webkit.org/show_bug.cgi?id=158125 is fixed.
-    return session.execute_script("return !!(window.fullScreen || document.webkitIsFullScreen)")
-
 def test_fullscreen(session):
     """
     4. Call fullscreen an element with the current top-level browsing
     context's active document's document element.
 
     """
     response = fullscreen(session)
     assert_success(response)
--- a/testing/web-platform/tests/webdriver/tests/minimize_window.py
+++ b/testing/web-platform/tests/webdriver/tests/minimize_window.py
@@ -5,16 +5,21 @@ from tests.support.inline import inline
 
 alert_doc = inline("<script>window.alert()</script>")
 
 
 def minimize(session):
     return session.transport.send("POST", "session/%s/window/minimize" % session.session_id)
 
 
+def is_fullscreen(session):
+    # At the time of writing, WebKit does not conform to the Fullscreen API specification.
+    # Remove the prefixed fallback when https://bugs.webkit.org/show_bug.cgi?id=158125 is fixed.
+    return session.execute_script("return !!(window.fullScreen || document.webkitIsFullScreen)")
+
 # 10.7.4 Minimize Window
 
 
 def test_no_browsing_context(session, create_window):
     """
     1. If the current top-level browsing context is no longer open,
     return error with error code no such window.
 
@@ -130,21 +135,21 @@ def test_fully_exit_fullscreen(session):
 
       2. Unfullscreen elements whose fullscreen flag is set, within
       document's top layer, except for document's fullscreen element.
 
       3. Exit fullscreen document.
 
     """
     session.window.fullscreen()
-    assert session.execute_script("return window.fullScreen") is True
+    assert is_fullscreen(session) is True
 
     response = minimize(session)
     assert_success(response)
-    assert session.execute_script("return window.fullScreen") is False
+    assert is_fullscreen(session) is False
     assert session.execute_script("return document.hidden") is True
 
 
 def test_minimize(session):
     """
     5. Iconify the window.
 
     [...]
--- a/testing/web-platform/tests/webdriver/tests/set_window_rect.py
+++ b/testing/web-platform/tests/webdriver/tests/set_window_rect.py
@@ -8,16 +8,21 @@ from tests.support.inline import inline
 
 
 alert_doc = inline("<script>window.alert()</script>")
 
 
 def set_window_rect(session, rect):
     return session.transport.send("POST", "session/%s/window/rect" % session.session_id, rect)
 
+def is_fullscreen(session):
+    # At the time of writing, WebKit does not conform to the Fullscreen API specification.
+    # Remove the prefixed fallback when https://bugs.webkit.org/show_bug.cgi?id=158125 is fixed.
+    return session.execute_script("return !!(window.fullScreen || document.webkitIsFullScreen)")
+
 
 # 10.7.2 Set Window Rect
 
 
 def test_current_top_level_browsing_context_no_longer_open(session, create_window):
     """
     1. If the current top-level browsing context is no longer open,
     return error with error code no such window.
@@ -288,24 +293,24 @@ def test_fully_exit_fullscreen(session):
       1. If document's fullscreen element is null, terminate these steps.
 
       2. Unfullscreen elements whose fullscreen flag is set, within
       document's top layer, except for document's fullscreen element.
 
       3. Exit fullscreen document.
     """
     session.window.fullscreen()
-    assert session.execute_script("return window.fullScreen") is True
+    assert is_fullscreen(session) is True
 
     response = set_window_rect(session, {"width": 400, "height": 400})
     value = assert_success(response)
     assert value["width"] == 400
     assert value["height"] == 400
 
-    assert session.execute_script("return window.fullScreen") is False
+    assert is_fullscreen(session) is False
 
 
 def test_restore_from_minimized(session):
     """
     12. If the visibility state of the top-level browsing context's
     active document is hidden, restore the window.
 
     [...]