Commit a4a56f0e authored by Stephen McGruer's avatar Stephen McGruer Committed by Chromium LUCI CQ

[wptrunner] Fixes for run_wpt_tests.py on Win and Mac

The chrome and chromedriver binaries are named different or in different
places on these platforms.

Bug: None
Change-Id: I4c551fba8752bd1efeddf89ca34a9191587f53c6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2557220Reviewed-by: default avatarLuke Z <lpz@chromium.org>
Commit-Queue: Stephen McGruer <smcgruer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#844225}
parent 00e31f67
...@@ -34,6 +34,7 @@ WPT_OVERRIDE_EXPECTATIONS_PATH = ( ...@@ -34,6 +34,7 @@ WPT_OVERRIDE_EXPECTATIONS_PATH = (
"../../third_party/blink/web_tests/WPTOverrideExpectations") "../../third_party/blink/web_tests/WPTOverrideExpectations")
CHROME_BINARY = "../../out/{}/chrome" CHROME_BINARY = "../../out/{}/chrome"
CHROME_BINARY_MAC = "../../out/{}/Chromium.app/Contents/MacOS/Chromium"
CHROMEDRIVER_BINARY = "../../out/{}/chromedriver" CHROMEDRIVER_BINARY = "../../out/{}/chromedriver"
DEFAULT_ISOLATED_SCRIPT_TEST_OUTPUT = "../../out/{}/results.json" DEFAULT_ISOLATED_SCRIPT_TEST_OUTPUT = "../../out/{}/results.json"
...@@ -50,6 +51,14 @@ class WPTTestAdapter(wpt_common.BaseWptScriptAdapter): ...@@ -50,6 +51,14 @@ class WPTTestAdapter(wpt_common.BaseWptScriptAdapter):
# Update the output directory to the default if it's not set. # Update the output directory to the default if it's not set.
self.maybe_set_default_isolated_script_test_output() self.maybe_set_default_isolated_script_test_output()
chrome = CHROME_BINARY.format(self.options.target)
chromedriver = CHROMEDRIVER_BINARY.format(self.options.target)
if self.port.host.platform.is_win():
chrome = "%s.exe" % chrome
chromedriver = "%s.exe" % chromedriver
elif self.port.host.platform.is_mac():
chrome = CHROME_BINARY_MAC.format(self.options.target)
# Here we add all of the arguments required to run WPT tests on Chrome. # Here we add all of the arguments required to run WPT tests on Chrome.
rest_args.extend([ rest_args.extend([
"../../third_party/blink/tools/blinkpy/third_party/wpt/wpt/wpt", "../../third_party/blink/tools/blinkpy/third_party/wpt/wpt/wpt",
...@@ -60,14 +69,13 @@ class WPTTestAdapter(wpt_common.BaseWptScriptAdapter): ...@@ -60,14 +69,13 @@ class WPTTestAdapter(wpt_common.BaseWptScriptAdapter):
"run", "run",
"chrome" "chrome"
] + self.options.test_list + [ ] + self.options.test_list + [
"--binary=" + CHROME_BINARY.format(self.options.target), "--binary=" + chrome,
"--binary-arg=--host-resolver-rules=" "--binary-arg=--host-resolver-rules="
"MAP nonexistent.*.test ~NOTFOUND, MAP *.test 127.0.0.1", "MAP nonexistent.*.test ~NOTFOUND, MAP *.test 127.0.0.1",
"--binary-arg=--enable-experimental-web-platform-features", "--binary-arg=--enable-experimental-web-platform-features",
"--binary-arg=--enable-blink-test-features", "--binary-arg=--enable-blink-test-features",
"--binary-arg=--enable-blink-features=MojoJS,MojoJSTest", "--binary-arg=--enable-blink-features=MojoJS,MojoJSTest",
"--webdriver-binary=" + CHROMEDRIVER_BINARY.format( "--webdriver-binary=" + chromedriver,
self.options.target),
"--webdriver-arg=--enable-chrome-logs", "--webdriver-arg=--enable-chrome-logs",
"--headless", "--headless",
"--no-capture-stdio", "--no-capture-stdio",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment