tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit 7f22f480b56a89f79ed3b79778ec52616117e392
parent 61a14468d72af2e2740f9df953c2db21831793a2
Author: Martin Robinson <mrobinson@igalia.com>
Date:   Thu,  9 Oct 2025 20:33:13 +0000

Bug 1992151 [wpt PR 55174] - servodriver: Use the `wpt-prefs.json` file when running servoshell, a=testonly

Automatic update from web-platform-tests
servodriver: Use the `wpt-prefs.json` file when running servoshell

These preferences are necessary in order for tests to run properly in
servodriver.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>

--

wpt-commits: 0eb8418cc75c01ba696f38d293a786d838e023ac
wpt-pr: 55174

Diffstat:
Mtesting/web-platform/tests/tools/wptrunner/wptrunner/browsers/servodriver.py | 18++++++++++++++++++
1 file changed, 18 insertions(+), 0 deletions(-)

diff --git a/testing/web-platform/tests/tools/wptrunner/wptrunner/browsers/servodriver.py b/testing/web-platform/tests/tools/wptrunner/wptrunner/browsers/servodriver.py @@ -113,9 +113,13 @@ class ServoWebDriverBrowser(WebDriverBrowser): if headless: args += ["--headless"] + # Add the shared `wpt-prefs.json` file to the list of arguments. + args += ["--prefs-file", self.find_wpt_prefs(logger)] + super().__init__(logger, binary=binary, webdriver_binary=binary, webdriver_args=args, host=webdriver_host, env=env, supports_pac=False, **kwargs) + self.hosts_path = hosts_path def make_command(self): @@ -124,3 +128,17 @@ class ServoWebDriverBrowser(WebDriverBrowser): def cleanup(self): super().cleanup() os.remove(self.hosts_path) + + def find_wpt_prefs(self, logger): + default_path = os.path.join("resources", "wpt-prefs.json") + # The cwd is the servo repo for `./mach test-wpt`, but on WPT runners + # it is the WPT repo. The nightly tar is extracted inside the Python + # virtual environment within the repo. This means that on WPT runners, + # the cwd has the `_venv3/servo` directory inside which we find the + # binary and the 'resources' directory. + for dir in [".", "./_venv3/servo"]: + candidate = os.path.abspath(os.path.join(dir, default_path)) + if os.path.isfile(candidate): + return candidate + logger.error("Unable to find wpt-prefs.json") + return default_path