Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only use new headless mode for Chrome #44304

Merged
merged 2 commits into from
Jan 31, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions tools/wptrunner/wptrunner/browsers/chrome.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,19 +139,17 @@ def executor_kwargs(logger, test_type, test_environment, run_info_data,
if kwargs["enable_experimental"]:
chrome_options["args"].extend(["--enable-experimental-web-platform-features"])

new_headless_mode = ("--headless=new" in kwargs.get("binary_args", []))

# Pass the --headless flag to Chrome if WPT's own --headless flag was set
# or if we're running print reftests because of crbug.com/753118
if ((kwargs["headless"] or test_type == "print-reftest") and
"--headless" not in chrome_options["args"] and not new_headless_mode):
chrome_options["args"].append("--headless")

# Copy over any other flags that were passed in via `--binary-arg`
for arg in kwargs.get("binary_args", []):
if arg not in chrome_options["args"]:
chrome_options["args"].append(arg)

# Pass the --headless=new flag to Chrome if WPT's own --headless flag was
# set. '--headless' should always mean the new headless mode, as the old
# headless mode is not used anyway.
if kwargs["headless"] and "--headless=new" not in chrome_options["args"]:
chrome_options["args"].append("--headless=new")

if test_type == "wdspec":
executor_kwargs["binary_args"] = chrome_options["args"]

Expand Down