From 02268e9c60a8fd08d5776bc794d8c370f5c9c874 Mon Sep 17 00:00:00 2001 From: Tim Ledbetter Date: Mon, 14 Oct 2024 20:54:36 +0100 Subject: [PATCH] Meta: Use `headless-browser` by default when running tests with `WPT.sh` This change removes the `--headless` option, which is now the default behavior and adds the `--show-window` option to force tests to run in a visible browser window. --- Meta/WPT.sh | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/Meta/WPT.sh b/Meta/WPT.sh index c13d6d8ec42..64777e56775 100755 --- a/Meta/WPT.sh +++ b/Meta/WPT.sh @@ -103,12 +103,12 @@ set_logging_flags() WPT_ARGS+=( "${log_type}=${log_name}" ) } +headless=1 ARG=$1 -while [[ "$ARG" =~ ^(--headless|(--log(-(raw|unittest|xunit|html|mach|tbpl|grouped|chromium|wptreport|wptscreenshot))?))$ ]]; do +while [[ "$ARG" =~ ^(--show-window|(--log(-(raw|unittest|xunit|html|mach|tbpl|grouped|chromium|wptreport|wptscreenshot))?))$ ]]; do case "$ARG" in - --headless) - LADYBIRD_BINARY="$(default_binary_path)/headless-browser" - WPT_ARGS+=( "--webdriver-arg=--headless" ) + --show-window) + headless=0 ;; --log) set_logging_flags "--log-raw" "${2}" @@ -124,7 +124,13 @@ while [[ "$ARG" =~ ^(--headless|(--log(-(raw|unittest|xunit|html|mach|tbpl|group ARG=$1 done -WPT_ARGS+=( "--binary=${LADYBIRD_BINARY}" ) +if [ $headless -eq 1 ]; then + WPT_ARGS+=( "--binary=${HEADLESS_BROWSER_BINARY}" ) + WPT_ARGS+=( "--webdriver-arg=--headless" ) +else + WPT_ARGS+=( "--binary=${LADYBIRD_BINARY}" ) +fi + TEST_LIST=( "$@" ) for i in "${!TEST_LIST[@]}"; do @@ -173,8 +179,8 @@ execute_wpt() { fi WPT_ARGS+=( "--webdriver-arg=--certificate=${certificate_path}" ) done - echo QT_QPA_PLATFORM="offscreen" LADYBIRD_GIT_VERSION="$(ladybird_git_hash)" ./wpt run "${WPT_ARGS[@]}" ladybird "${TEST_LIST[@]}" - QT_QPA_PLATFORM="offscreen" LADYBIRD_GIT_VERSION="$(ladybird_git_hash)" ./wpt run "${WPT_ARGS[@]}" ladybird "${TEST_LIST[@]}" + echo LADYBIRD_GIT_VERSION="$(ladybird_git_hash)" ./wpt run "${WPT_ARGS[@]}" ladybird "${TEST_LIST[@]}" + LADYBIRD_GIT_VERSION="$(ladybird_git_hash)" ./wpt run "${WPT_ARGS[@]}" ladybird "${TEST_LIST[@]}" popd > /dev/null }