From 5ba0c8ebd6c73c67abdf21dce9ccdc8fa8849f64 Mon Sep 17 00:00:00 2001 From: Carlos Alberto Lopez Perez Date: Wed, 4 Dec 2024 19:53:36 +0000 Subject: [PATCH] [wptrunner] On WebKitGTK-based browsers do not open the new test window in a tab WPT commit bef892c changed some things on the webdriver executor, like: 1. Open the new window for the test via webdriver command "/window/new" instead of using injected javascript to open the new window. 2. Open the new window as tab by default instead as of a separate window And in the case of WebKitGTK-based browsers there is currently a bug that when the new test window is opened in a tab instead in a standalone window it causes many timeouts and failures on the WPT tests. This has been reported to WebKitGTK here https://webkit.org/b/283392 So this commits defaults back the new test window to be an standalone window instead of a tab for the WebkitGTK-based browsers meanwhile the issue is not fixed there. Related issue: #49262 --- tools/wptrunner/wptrunner/executors/executorwebdriver.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/wptrunner/wptrunner/executors/executorwebdriver.py b/tools/wptrunner/wptrunner/executors/executorwebdriver.py index 243290841f1b73..71cd5dae9fad6e 100644 --- a/tools/wptrunner/wptrunner/executors/executorwebdriver.py +++ b/tools/wptrunner/wptrunner/executors/executorwebdriver.py @@ -77,7 +77,11 @@ def execute_script(self, script, asynchronous=False, args=None): def set_timeout(self, timeout): self.webdriver.timeouts.script = timeout - def create_window(self, type="tab", **kwargs): + def create_window(self, type=None, **kwargs): + # WebKitGTK-based browsers have issues when the test is opened in a new tab instead of a separate window + # See: https://github.com/web-platform-tests/wpt/issues/49262 and https://webkit.org/b/283392 + if type is None: + type = 'window' if 'webkitgtk:browserOptions' in self.parent.capabilities else 'tab' return self.webdriver.new_window(type_hint=type) @property