From 9813da4d7cd750518431731a27a3318b6da9ccb5 Mon Sep 17 00:00:00 2001 From: Weizhong Xia Date: Wed, 31 Jan 2024 00:00:16 +0000 Subject: [PATCH 1/2] Only use new headless mode for Chrome We are going to use headful mode in Chromium, and results for wpt.fyi also comes from headful mode, thus there is no need to run tests in the old headless mode. crbug.com/753118 is also fixed now. Remove the special handling for print-ref tests also. --- tools/wptrunner/wptrunner/browsers/chrome.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/tools/wptrunner/wptrunner/browsers/chrome.py b/tools/wptrunner/wptrunner/browsers/chrome.py index 4669ec402e5488..27d2f70716d483 100644 --- a/tools/wptrunner/wptrunner/browsers/chrome.py +++ b/tools/wptrunner/wptrunner/browsers/chrome.py @@ -139,13 +139,11 @@ 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") + # 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") # Copy over any other flags that were passed in via `--binary-arg` for arg in kwargs.get("binary_args", []): From 76f6fcdf5a793c26f47741272c43625ae4e95de1 Mon Sep 17 00:00:00 2001 From: Weizhong Xia Date: Wed, 31 Jan 2024 00:11:12 +0000 Subject: [PATCH 2/2] swap the logic a little bit --- tools/wptrunner/wptrunner/browsers/chrome.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/wptrunner/wptrunner/browsers/chrome.py b/tools/wptrunner/wptrunner/browsers/chrome.py index 27d2f70716d483..06f3d34f3f0ac3 100644 --- a/tools/wptrunner/wptrunner/browsers/chrome.py +++ b/tools/wptrunner/wptrunner/browsers/chrome.py @@ -139,17 +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"]) + # 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") - # 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) - if test_type == "wdspec": executor_kwargs["binary_args"] = chrome_options["args"]