commit d19a57147ac10135f1b5f5bcf314d9a2afff4946
parent a45732d1053eefd2c9245507efe8e7d752c6f438
Author: Martin Robinson <mrobinson@igalia.com>
Date: Thu, 6 Nov 2025 21:33:16 +0000
Bug 1997362 [wpt PR 55767] - wpt: Properly process the `--headless` argument, a=testonly
Automatic update from web-platform-tests
wpt: Properly process the `--headless` argument
Instead of ignoring the `--headless` argument to the WPT test runner,
properly use it to turno on headless mode in Servo when its provided.
Additionally, when more than a single test is run, turn on headless mode
automatically to preserve existing behavior.
Although this change is for the legacy test driver, this will allow the
WebDriver test runner to run properly without providing the `--headless`
argument.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
--
Remove type annotation.
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
--
wpt-commits: 445a894ef28f2d7aa6d88e6544eaacccea01cb00, 18191ea5c9eb74b6e8cc1ad2ea0bbdafd554155c
wpt-pr: 55767
Diffstat:
2 files changed, 15 insertions(+), 9 deletions(-)
diff --git a/testing/web-platform/tests/tools/wptrunner/wptrunner/browsers/servo.py b/testing/web-platform/tests/tools/wptrunner/wptrunner/browsers/servo.py
@@ -51,6 +51,7 @@ def executor_kwargs(logger, test_type, test_environment, run_info_data,
**kwargs):
rv = base_executor_kwargs(test_type, test_environment, run_info_data, **kwargs)
rv["pause_after_test"] = kwargs["pause_after_test"]
+ rv["headless"] = kwargs.get("headless", False)
if test_type == "wdspec":
rv["capabilities"] = {}
return rv
diff --git a/testing/web-platform/tests/tools/wptrunner/wptrunner/executors/executorservo.py b/testing/web-platform/tests/tools/wptrunner/wptrunner/executors/executorservo.py
@@ -28,7 +28,8 @@ webdriver = None
class ServoExecutor(ProcessTestExecutor):
- def __init__(self, logger, browser, server_config, timeout_multiplier, debug_info,
+ def __init__(self, logger, browser, server_config, headless,
+ timeout_multiplier, debug_info,
pause_after_test, reftest_screenshot="unexpected"):
ProcessTestExecutor.__init__(self, logger, browser, server_config,
timeout_multiplier=timeout_multiplier,
@@ -37,6 +38,7 @@ class ServoExecutor(ProcessTestExecutor):
self.pause_after_test = pause_after_test
self.environment = {}
self.protocol = ConnectionlessProtocol(self, browser)
+ self.headless = headless
self.wpt_prefs_path = self.find_wpt_prefs()
@@ -87,8 +89,10 @@ class ServoExecutor(ProcessTestExecutor):
# For some reason rustls does not like the certificate generated by the WPT tooling.
"--ignore-certificate-errors",
"--enable-experimental-web-platform-features",
- "-z", self.test_url(test),
+ self.test_url(test),
]
+ if self.headless:
+ args += ["-z"]
for stylesheet in self.browser.user_stylesheets:
args += ["--user-stylesheet", stylesheet]
for pref, value in self.environment.get('prefs', {}).items():
@@ -100,17 +104,16 @@ class ServoExecutor(ProcessTestExecutor):
args += extra_args
args += self.browser.binary_args
debug_args, command = browser_command(self.binary, args, self.debug_info)
- if self.pause_after_test:
- command.remove("-z")
return debug_args + command
class ServoTestharnessExecutor(ServoExecutor):
convert_result = testharness_result_converter
- def __init__(self, logger, browser, server_config, timeout_multiplier=1, debug_info=None,
+ def __init__(self, logger, browser, server_config, headless,
+ timeout_multiplier=1, debug_info=None,
pause_after_test=False, **kwargs):
- ServoExecutor.__init__(self, logger, browser, server_config,
+ ServoExecutor.__init__(self, logger, browser, server_config, headless,
timeout_multiplier=timeout_multiplier,
debug_info=debug_info,
pause_after_test=pause_after_test)
@@ -211,6 +214,7 @@ class ServoRefTestExecutor(ServoExecutor):
logger,
browser,
server_config,
+ headless=True,
timeout_multiplier=timeout_multiplier,
debug_info=debug_info,
reftest_screenshot=reftest_screenshot,
@@ -300,13 +304,14 @@ class ServoTimedRunner(TimedRunner):
class ServoCrashtestExecutor(ServoExecutor):
convert_result = crashtest_result_converter
- def __init__(self, logger, browser, server_config, binary=None, timeout_multiplier=1,
- screenshot_cache=None, debug_info=None, pause_after_test=False,
- **kwargs):
+ def __init__(self, logger, browser, server_config, headless,
+ binary=None, timeout_multiplier=1, screenshot_cache=None,
+ debug_info=None, pause_after_test=False):
ServoExecutor.__init__(self,
logger,
browser,
server_config,
+ headless,
timeout_multiplier=timeout_multiplier,
debug_info=debug_info,
pause_after_test=pause_after_test)