Title: [281430] trunk
Revision
281430
Author
lmo...@igalia.com
Date
2021-08-22 18:41:34 -0700 (Sun, 22 Aug 2021)

Log Message

[WPE][WebDriver] Basic fullscreen support for the headless backend
https://bugs.webkit.org/show_bug.cgi?id=229380

Reviewed by Adrian Perez de Castro.

Tools:

r280774 added support for fullscreen in the WindowViewBackend, but
many webdriver tests started failing as they run in the headless
backend.

This commits adds basic support in HeadlessBackend to make some
tests pass. Currently, just storing the fullscreen state and
forwarding the events to the WPE backend functions.

A number of tests are still failing due to the missing multiple window
support (required through the `session` fixtures), but also there are
still some failing that expect the view to be started in
non-fullscreen mode, which does not happen in the headless backend.

* wpe/backends/HeadlessViewBackend.cpp:
(WPEToolingBackends::HeadlessViewBackend::HeadlessViewBackend):
(WPEToolingBackends::HeadlessViewBackend::onDOMFullScreenRequest):
(WPEToolingBackends::HeadlessViewBackend::dispatchFullscreenEvent):
* wpe/backends/HeadlessViewBackend.h:

WebDriverTests:

* TestExpectations.json: Skip some tests still failing, mainly due to multiple window support missing.

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (281429 => 281430)


--- trunk/Tools/ChangeLog	2021-08-23 01:06:11 UTC (rev 281429)
+++ trunk/Tools/ChangeLog	2021-08-23 01:41:34 UTC (rev 281430)
@@ -1,3 +1,29 @@
+2021-08-22  Lauro Moura  <lmo...@igalia.com>
+
+        [WPE][WebDriver] Basic fullscreen support for the headless backend
+        https://bugs.webkit.org/show_bug.cgi?id=229380
+
+        Reviewed by Adrian Perez de Castro.
+
+        r280774 added support for fullscreen in the WindowViewBackend, but
+        many webdriver tests started failing as they run in the headless
+        backend.
+
+        This commits adds basic support in HeadlessBackend to make some
+        tests pass. Currently, just storing the fullscreen state and
+        forwarding the events to the WPE backend functions.
+
+        A number of tests are still failing due to the missing multiple window
+        support (required through the `session` fixtures), but also there are
+        still some failing that expect the view to be started in
+        non-fullscreen mode, which does not happen in the headless backend.
+
+        * wpe/backends/HeadlessViewBackend.cpp:
+        (WPEToolingBackends::HeadlessViewBackend::HeadlessViewBackend):
+        (WPEToolingBackends::HeadlessViewBackend::onDOMFullScreenRequest):
+        (WPEToolingBackends::HeadlessViewBackend::dispatchFullscreenEvent):
+        * wpe/backends/HeadlessViewBackend.h:
+
 2021-08-22  Yusuke Suzuki  <ysuz...@apple.com>
 
         [JSC] Remove already-shipped JS feature flags

Modified: trunk/Tools/wpe/backends/HeadlessViewBackend.cpp (281429 => 281430)


--- trunk/Tools/wpe/backends/HeadlessViewBackend.cpp	2021-08-23 01:06:11 UTC (rev 281429)
+++ trunk/Tools/wpe/backends/HeadlessViewBackend.cpp	2021-08-23 01:41:34 UTC (rev 281430)
@@ -100,6 +100,10 @@
         cairo_surface_mark_dirty(m_snapshot);
     }
 
+#if WPE_CHECK_VERSION(1, 11, 1)
+    wpe_view_backend_set_fullscreen_handler(backend(), onDOMFullScreenRequest, this);
+#endif
+
     m_update.source = g_timeout_source_new(G_USEC_PER_SEC / 60000);
     g_source_set_callback(m_update.source, [](gpointer data) -> gboolean {
         static_cast<HeadlessViewBackend*>(data)->vsync();
@@ -196,4 +200,29 @@
     m_update.pending = false;
 }
 
+#if WPE_CHECK_VERSION(1, 11, 1)
+bool HeadlessViewBackend::onDOMFullScreenRequest(void* data, bool fullscreen)
+{
+    auto& headless = *static_cast<HeadlessViewBackend*>(data);
+
+    if (fullscreen == headless.m_is_fullscreen) {
+        // Handle situations where DOM fullscreen requests are mixed with system fullscreen commands (e.g F11)
+        headless.dispatchFullscreenEvent();
+        return true;
+    }
+    headless.m_is_fullscreen = fullscreen;
+    return true;
+}
+
+void HeadlessViewBackend::dispatchFullscreenEvent()
+{
+    if (m_is_fullscreen)
+        wpe_view_backend_dispatch_did_enter_fullscreen(backend());
+    else
+        wpe_view_backend_dispatch_did_exit_fullscreen(backend());
+}
+
+#endif
+
+
 } // namespace WPEToolingBackends

Modified: trunk/Tools/wpe/backends/HeadlessViewBackend.h (281429 => 281430)


--- trunk/Tools/wpe/backends/HeadlessViewBackend.h	2021-08-23 01:06:11 UTC (rev 281429)
+++ trunk/Tools/wpe/backends/HeadlessViewBackend.h	2021-08-23 01:41:34 UTC (rev 281430)
@@ -44,6 +44,12 @@
     void updateSnapshot(struct wpe_fdo_shm_exported_buffer*);
     void vsync();
 
+#if WPE_CHECK_VERSION(1, 11, 1)
+    static bool onDOMFullScreenRequest(void* data, bool fullscreen);
+    void dispatchFullscreenEvent();
+#endif
+
+
     struct wpe_view_backend_exportable_fdo* m_exportable { nullptr };
 
     cairo_surface_t* m_snapshot { nullptr };
@@ -52,6 +58,10 @@
         GSource* source { nullptr };
         bool pending { false };
     } m_update;
+
+#if WPE_CHECK_VERSION(1, 11, 1)
+    bool m_is_fullscreen { false };
+#endif
 };
 
 } // namespace WPEToolingBackends

Modified: trunk/WebDriverTests/ChangeLog (281429 => 281430)


--- trunk/WebDriverTests/ChangeLog	2021-08-23 01:06:11 UTC (rev 281429)
+++ trunk/WebDriverTests/ChangeLog	2021-08-23 01:41:34 UTC (rev 281430)
@@ -1,3 +1,12 @@
+2021-08-22  Lauro Moura  <lmo...@igalia.com>
+
+        [WPE][WebDriver] Basic fullscreen support for the headless backend
+        https://bugs.webkit.org/show_bug.cgi?id=229380
+
+        Reviewed by Adrian Perez de Castro.
+
+        * TestExpectations.json: Skip some tests still failing, mainly due to multiple window support missing.
+
 2021-05-23  Lauro Moura  <lmo...@igalia.com>
 
         [WebDriver] Gardening local GTK and WPE failures

Modified: trunk/WebDriverTests/TestExpectations.json (281429 => 281430)


--- trunk/WebDriverTests/TestExpectations.json	2021-08-23 01:06:11 UTC (rev 281429)
+++ trunk/WebDriverTests/TestExpectations.json	2021-08-23 01:41:34 UTC (rev 281430)
@@ -1063,15 +1063,70 @@
 
     "imported/w3c/webdriver/tests/fullscreen_window/fullscreen.py": {
         "subtests": {
+            "notes": "Some WPE tests are skipped as they trigger failure or timeout regardless of the expectation if they are run. Also, some tests expect the browser to start in non fullscreen mode, which isn't happening in the headless backend.",
+            "test_fullscreen": {
+                "expected": {"wpe": {"status": ["SKIP"], "bug": "webkit.org/b/212950"}}
+            },
+            "test_fullscreen_twice_is_idempotent": {
+                "expected": {"wpe": {"status": ["SKIP"], "bug": "webkit.org/b/212950"}},
+                "notes": "This test also expects the browser to start in non-fullscreen mode, which is failing right now"
+            },
             "test_no_top_browsing_context": {
                 "expected": {"wpe": {"status": ["FAIL"], "bug": "webkit.org/b/212950"}}
             },
             "test_no_browsing_context": {
                 "expected": {"wpe": {"status": ["FAIL"], "bug": "webkit.org/b/212950"}}
+            },
+            "test_payload": {
+                "expected": {"wpe": {"status": ["SKIP"], "bug": "webkit.org/b/212950"}}
             }
         }
     },
 
+    "imported/w3c/webdriver/tests/fullscreen_window/user_prompts.py": {
+        "subtests": {
+            "notes": "Some WPE tests are skipped as they trigger failure or timeout regardless of the expectation if they are run. Also, some tests expect the browser to start in non fullscreen mode, which isn't happening in the headless backend.",
+            "test_accept[capabilities0-alert-None]": {
+                "expected": {"wpe": {"status": ["SKIP"], "bug": "webkit.org/b/212950"}}
+            },
+            "test_accept[capabilities0-confirm-True]": {
+                "expected": {"wpe": {"status": ["SKIP"], "bug": "webkit.org/b/212950"}}
+            },
+            "test_accept[capabilities0-prompt-]": {
+                "expected": {"wpe": {"status": ["SKIP"], "bug": "webkit.org/b/212950"}}
+            },
+            "test_dismiss[capabilities0-alert-None]": {
+                "expected": {"wpe": {"status": ["SKIP"], "bug": "webkit.org/b/212950"}}
+            },
+            "test_dismiss[capabilities0-confirm-False]": {
+                "expected": {"wpe": {"status": ["SKIP"], "bug": "webkit.org/b/212950"}}
+            },
+            "test_dismiss[capabilities0-prompt-None]": {
+                "expected": {"wpe": {"status": ["SKIP"], "bug": "webkit.org/b/212950"}}
+            }
+        }
+    },
+    "imported/w3c/webdriver/tests/fullscreen_window/stress.py": {
+        "subtests": {
+            "notes": "Some WPE tests are skipped as they trigger failure or timeout regardless of the expectation if they are run. Also, some tests expect the browser to start in non fullscreen mode, which isn't happening in the headless backend.",
+            "test_stress[0]": {
+                "expected": {"wpe": {"status": ["SKIP"], "bug": "webkit.org/b/212950"}}
+            },
+            "test_stress[1]": {
+                "expected": {"wpe": {"status": ["SKIP"], "bug": "webkit.org/b/212950"}}
+            },
+            "test_stress[2]": {
+                "expected": {"wpe": {"status": ["SKIP"], "bug": "webkit.org/b/212950"}}
+            },
+            "test_stress[3]": {
+                "expected": {"wpe": {"status": ["SKIP"], "bug": "webkit.org/b/212950"}}
+            },
+            "test_stress[4]": {
+                "expected": {"wpe": {"status": ["SKIP"], "bug": "webkit.org/b/212950"}}
+            }
+        }
+    },
+
     "imported/w3c/webdriver/tests/get_alert_text/get.py": {
         "subtests": {
             "test_no_top_browsing_context": {
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to