mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-12 11:09:18 +00:00
Meta: Add a flag to WPT.sh to run Ladybird headlessly
We have more work to do before we can run WPT headlessly by default (i.e. handling alerts). But for now, we can run it headlessly locally with the --headless flag.
This commit is contained in:
parent
b24a7079f1
commit
14c3bff5da
Notes:
github-actions[bot]
2024-10-22 03:25:25 +00:00
Author: https://github.com/trflynn89
Commit: 14c3bff5da
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1907
Reviewed-by: https://github.com/tcl3 ✅
1 changed files with 26 additions and 11 deletions
37
Meta/WPT.sh
37
Meta/WPT.sh
|
@ -18,9 +18,9 @@ BUILD_DIR=$(get_build_dir "$BUILD_PRESET")
|
|||
|
||||
default_binary_path() {
|
||||
if [ "$(uname -s)" = "Darwin" ]; then
|
||||
echo "${BUILD_DIR}/bin/Ladybird.app/Contents/MacOS/"
|
||||
echo "${BUILD_DIR}/bin/Ladybird.app/Contents/MacOS"
|
||||
else
|
||||
echo "${BUILD_DIR}/bin/"
|
||||
echo "${BUILD_DIR}/bin"
|
||||
fi
|
||||
}
|
||||
|
||||
|
@ -31,8 +31,7 @@ WPT_CERTIFICATES=(
|
|||
"tools/certs/cacert.pem"
|
||||
"${LADYBIRD_SOURCE_DIR}/Build/ladybird/Lagom/cacert.pem"
|
||||
)
|
||||
WPT_ARGS=( "--binary=${LADYBIRD_BINARY}"
|
||||
"--webdriver-binary=${WEBDRIVER_BINARY}"
|
||||
WPT_ARGS=( "--webdriver-binary=${WEBDRIVER_BINARY}"
|
||||
"--install-webdriver"
|
||||
"--processes=${WPT_PROCESSES}"
|
||||
"--webdriver-arg=--force-cpu-painting"
|
||||
|
@ -82,23 +81,39 @@ if [ "$CMD" = "--help" ] || [ "$CMD" = "help" ]; then
|
|||
exit 0
|
||||
fi
|
||||
|
||||
set_logging_flags()
|
||||
{
|
||||
[ -n "${1}" ] || usage;
|
||||
[ -n "${2}" ] || usage;
|
||||
|
||||
log_type="${1}"
|
||||
log_name="$(pwd -P)/${2}"
|
||||
|
||||
WPT_ARGS+=( "${log_type}=${log_name}" )
|
||||
}
|
||||
|
||||
ARG=$1
|
||||
while [[ "$ARG" =~ ^--log(-(raw|unittest|xunit|html|mach|tbpl|grouped|chromium|wptreport|wptscreenshot))?$ ]]; do
|
||||
while [[ "$ARG" =~ ^(--headless|(--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" )
|
||||
;;
|
||||
--log)
|
||||
LOG_TYPE="--log-raw"
|
||||
set_logging_flags "--log-raw" "${2}"
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
LOG_TYPE="$ARG"
|
||||
set_logging_flags "${ARG}" "${2}"
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
LOG_NAME="$(pwd -P)/$1"
|
||||
[ -n "$LOG_NAME" ] || usage;
|
||||
WPT_ARGS+=( "${LOG_TYPE}=${LOG_NAME}" )
|
||||
|
||||
shift
|
||||
ARG=$1
|
||||
done
|
||||
|
||||
WPT_ARGS+=( "--binary=${LADYBIRD_BINARY}" )
|
||||
TEST_LIST=( "$@" )
|
||||
|
||||
exit_if_running_as_root "Do not run WPT.sh as root"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue