From 0a773b408acb2151b152380fd1f174a4f8ffe2cf Mon Sep 17 00:00:00 2001 From: sideshowbarker Date: Thu, 7 Nov 2024 03:08:42 +0900 Subject: [PATCH] =?UTF-8?q?Tests:=20Allow=20wpt.live=20URLs=20for=20both?= =?UTF-8?q?=20=E2=80=9CWPT.sh=20run=E2=80=9D=20and=20=E2=80=9CWPT.sh=20imp?= =?UTF-8?q?ort=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This change allows you to give http[s]://wpt.live/ URLs to the WPT.sh script for both the “WPT.sh run” and “WPT.sh import” commands. That facilitates the use case where you’ve navigated to a wpt.live URL in a browser, and you want to just directly copy-paste the URL in order to either run the test in Ladybird, or import the test into the repo. Otherwise, without this change, when using WPT.sh, you’re limited to needing to specify either a WPT path fragment or filesystem pathname — which doesn’t allow for easy copy-paste directly from wpt.fyi. --- Meta/WPT.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Meta/WPT.sh b/Meta/WPT.sh index 0724560ca2e8..c13d6d8ec421 100755 --- a/Meta/WPT.sh +++ b/Meta/WPT.sh @@ -131,6 +131,8 @@ for i in "${!TEST_LIST[@]}"; do item="${TEST_LIST[i]}" item="${item#"$WPT_SOURCE_DIR"/}" item="${item#*Tests/LibWeb/WPT/wpt/}" + item="${item#http://wpt.live/}" + item="${item#https://wpt.live/}" TEST_LIST[i]="$item" done @@ -193,6 +195,12 @@ serve_wpt() import_wpt() { + for i in "${!INPUT_PATHS[@]}"; do + item="${INPUT_PATHS[i]}" + item="${item#http://wpt.live/}" + item="${item#https://wpt.live/}" + INPUT_PATHS[i]="$item" + done pushd "${LADYBIRD_SOURCE_DIR}" > /dev/null ./Meta/ladybird.sh build headless-browser for path in "${INPUT_PATHS[@]}"; do