Skip to content

Commit

Permalink
Enable ShadowRealm testing for more URL APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
ptomato committed Oct 25, 2024
1 parent 9ea269c commit f382c0c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
3 changes: 2 additions & 1 deletion url/IdnaTestV2.window.js → url/IdnaTestV2.any.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
promise_test(() => fetch("resources/IdnaTestV2.json").then(res => res.json()).then(runTests), "Loading data…");
// META: global=window,dedicatedworker,shadowrealm
promise_test(() => fetch_json("resources/IdnaTestV2.json").then(runTests), "Loading data…");

// Performance impact of this seems negligible (performance.now() diff in WebKit went from 48 to 52)
// and there was a preference to let more non-ASCII hit the parser.
Expand Down
5 changes: 3 additions & 2 deletions url/url-constructor.any.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// META: global=window,dedicatedworker,shadowrealm
// META: script=/common/subset-tests-by-key.js
// META: timeout=long
// META: variant=?include=file
Expand Down Expand Up @@ -51,6 +52,6 @@ function runURLTests(urlTests) {
}

promise_test(() => Promise.all([
fetch("resources/urltestdata.json").then(res => res.json()),
fetch("resources/urltestdata-javascript-only.json").then(res => res.json()),
fetch_json("resources/urltestdata.json"),
fetch_json("resources/urltestdata-javascript-only.json"),
]).then((tests) => tests.flat()).then(runURLTests), "Loading data…");
5 changes: 3 additions & 2 deletions url/url-origin.any.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// META: global=window,dedicatedworker,shadowrealm
promise_test(() => Promise.all([
fetch("resources/urltestdata.json").then(res => res.json()),
fetch("resources/urltestdata-javascript-only.json").then(res => res.json()),
fetch_json("resources/urltestdata.json"),
fetch_json("resources/urltestdata-javascript-only.json"),
]).then((tests) => tests.flat()).then(runURLTests), "Loading data…");

function runURLTests(urlTests) {
Expand Down
3 changes: 2 additions & 1 deletion url/url-setters.any.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// META: global=window,dedicatedworker,shadowrealm
// META: script=/common/subset-tests-by-key.js
// META: variant=?include=file
// META: variant=?include=javascript
Expand All @@ -6,7 +7,7 @@

// Keep this file in sync with url-setters-a-area.window.js.

promise_test(() => fetch("resources/setters_tests.json").then(res => res.json()).then(runURLSettersTests), "Loading data…");
promise_test(() => fetch_json("resources/setters_tests.json").then(runURLSettersTests), "Loading data…");

function runURLSettersTests(all_test_cases) {
for (var attribute_to_be_set in all_test_cases) {
Expand Down

0 comments on commit f382c0c

Please sign in to comment.