mirror of
https://github.com/servo/servo.git
synced 2025-10-01 17:19:16 +01:00
servodriver: Use the wpt-prefs.json
file when running servoshell (#39605)
These preferences are necessary in order for tests to run properly in servodriver. Testing: This causes more tests to pass when WPT is run with `--product servodriver` Signed-off-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
parent
cfa9e711c5
commit
e49fcdeffd
2 changed files with 19 additions and 1 deletions
2
tests/wpt/meta/MANIFEST.json
vendored
2
tests/wpt/meta/MANIFEST.json
vendored
|
@ -529727,7 +529727,7 @@
|
||||||
[]
|
[]
|
||||||
],
|
],
|
||||||
"servodriver.py": [
|
"servodriver.py": [
|
||||||
"c25aa9b3ecdcfe20c6ff0e8f98973d69c86d5209",
|
"a4bf5e7cd75bbcabce532930ee97bfd506e06fc4",
|
||||||
[]
|
[]
|
||||||
],
|
],
|
||||||
"webkit.py": [
|
"webkit.py": [
|
||||||
|
|
|
@ -113,9 +113,13 @@ class ServoWebDriverBrowser(WebDriverBrowser):
|
||||||
if headless:
|
if headless:
|
||||||
args += ["--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,
|
super().__init__(logger, binary=binary, webdriver_binary=binary,
|
||||||
webdriver_args=args, host=webdriver_host, env=env,
|
webdriver_args=args, host=webdriver_host, env=env,
|
||||||
supports_pac=False, **kwargs)
|
supports_pac=False, **kwargs)
|
||||||
|
|
||||||
self.hosts_path = hosts_path
|
self.hosts_path = hosts_path
|
||||||
|
|
||||||
def make_command(self):
|
def make_command(self):
|
||||||
|
@ -124,3 +128,17 @@ class ServoWebDriverBrowser(WebDriverBrowser):
|
||||||
def cleanup(self):
|
def cleanup(self):
|
||||||
super().cleanup()
|
super().cleanup()
|
||||||
os.remove(self.hosts_path)
|
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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue