Skip to content

Commit 5471f68

Browse files
authored
wpt: Make legacy ServoWdspecBrowser work as intended (servo#40296)
servo#40289 (comment) intend to process `headless` param properly. For either `servo` or `servodriver` binary, the expected behaviour is: - When given one test, it should depends on cmd arg `--headless` - With multiple tests, we always default to `--headless` The subtle point is: `ServoWdspecBrowser` didn't process `headless` param at all and always default to headless. Also, `executor_kwargs` does not work for it but only `browser_kwargs` works as it does not use `ServoExecutor`. Testing: Manually tested with legacy driver, running in single/multiple tests, with/without headless param, with wdspec or none-wdspec test. Fixes: servo#40289 (comment) --------- Signed-off-by: Euclid Ye <[email protected]>
1 parent 3fa2e8c commit 5471f68

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

tests/wpt/meta/MANIFEST.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -533229,7 +533229,7 @@
533229533229
]
533230533230
},
533231533231
"servo.py": [
533232-
"b8cfd54ef61e5cdde9bef4e3673e508759adc566",
533232+
"7a95b08e7ad9ef88be26dfdaf4547b198a0a1439",
533233533233
[]
533234533234
],
533235533235
"servodriver.py": [

tests/wpt/tests/tools/wptrunner/wptrunner/browsers/servo.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ def browser_kwargs(logger, test_type, run_info_data, config, subsuite, **kwargs)
4242
"binary": kwargs["binary"],
4343
"debug_info": kwargs["debug_info"],
4444
"binary_args": kwargs["binary_args"] + subsuite.config.get("binary_args", []),
45+
"headless": kwargs["headless"],
4546
"user_stylesheets": kwargs.get("user_stylesheets"),
4647
"ca_certificate_path": config.ssl_config["ca_cert_path"],
4748
}
@@ -96,6 +97,7 @@ class ServoWdspecBrowser(WebDriverBrowser):
9697
# TODO: could share an implemenation with servodriver.py, perhaps
9798
def __init__(self, logger, binary="servo", webdriver_binary="servo",
9899
binary_args=None, webdriver_args=None, env=None, port=None,
100+
headless=None,
99101
**kwargs):
100102

101103
env = os.environ.copy() if env is None else env
@@ -109,6 +111,8 @@ def __init__(self, logger, binary="servo", webdriver_binary="servo",
109111
env=env,
110112
**kwargs)
111113
self.binary_args = binary_args
114+
self.headless = ["--headless"] if headless else None
115+
112116

113117
def make_command(self):
114118
command = [self.binary,
@@ -117,10 +121,11 @@ def make_command(self):
117121
# See https://github.com/servo/servo/issues/30080.
118122
# For some reason rustls does not like the certificate generated by the WPT tooling.
119123
"--ignore-certificate-errors",
120-
"--headless",
121124
"--window-size",
122125
"800x600",
123126
"about:blank"] + self.webdriver_args
124127
if self.binary_args:
125128
command += self.binary_args
129+
if self.headless:
130+
command += self.headless
126131
return command

0 commit comments

Comments
 (0)