Skip to content

test: update WPT for url to 9504a83e01 #57652

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion test/fixtures/wpt/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Last update:
- resource-timing: https://github.com/web-platform-tests/wpt/tree/22d38586d0/resource-timing
- resources: https://github.com/web-platform-tests/wpt/tree/1e140d63ec/resources
- streams: https://github.com/web-platform-tests/wpt/tree/bc9dcbbf1a/streams
- url: https://github.com/web-platform-tests/wpt/tree/d86fcc9e87/url
- url: https://github.com/web-platform-tests/wpt/tree/9504a83e01/url
- urlpattern: https://github.com/web-platform-tests/wpt/tree/6ceca69d26/urlpattern
- user-timing: https://github.com/web-platform-tests/wpt/tree/5ae85bf826/user-timing
- wasm/jsapi: https://github.com/web-platform-tests/wpt/tree/cde25e7e3c/wasm/jsapi
Expand Down
21 changes: 21 additions & 0 deletions test/fixtures/wpt/url/IdnaTestV2-removed.window.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
promise_test(() => fetch("resources/IdnaTestV2-removed.json").then(res => res.json()).then(runTests), "Loading data…");

function runTests(idnaTests) {
for (const idnaTest of idnaTests) {
if (typeof idnaTest === "string") {
continue // skip comments
}

test(() => {
if (idnaTest.output === null) {
assert_throws_js(TypeError, () => new URL(`https://${idnaTest.input}/x`));
} else {
const url = new URL(`https://${idnaTest.input}/x`);
assert_equals(url.host, idnaTest.output);
assert_equals(url.hostname, idnaTest.output);
assert_equals(url.pathname, "/x");
assert_equals(url.href, `https://${idnaTest.output}/x`);
}
}, `ToASCII("${idnaTest.input}")${idnaTest.comment ? " " + idnaTest.comment : ""}`);
}
}
104 changes: 104 additions & 0 deletions test/fixtures/wpt/url/resources/IdnaTestV2-removed.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
[
"This is generated with the help from ../tools/IdnaTestV2-compare.py.",
"These tests are from an older IdnaTestV2 and thus the comment line may no longer be accurate.",
{
"comment": "P1; V6; V3 (ignored)",
"input": "-\udb40\ude56\ua867\uff0e\udb40\ude82\ud8dc\udd83\ud83c\udd09",
"output": null
},
{
"comment": "P1; V5; V6",
"input": "\ud83c\udd04\uff0e\u1cdc\u2488\u00df",
"output": null
},
{
"comment": "P1; V5; V6",
"input": "\ud83c\udd04\uff0e\u1cdc\u2488SS",
"output": null
},
{
"comment": "P1; V5; V6",
"input": "\ud83c\udd04\uff0e\u1cdc\u2488ss",
"output": null
},
{
"comment": "P1; V5; V6",
"input": "\ud83c\udd04\uff0e\u1cdc\u2488Ss",
"output": null
},
{
"comment": "C2; P1; V6",
"input": "\u0756\u3002\u3164\u200d\u03c2",
"output": null
},
{
"comment": "C2; P1; V6",
"input": "\u0756\u3002\u1160\u200d\u03c2",
"output": null
},
{
"comment": "C2; P1; V6",
"input": "\u0756\u3002\u1160\u200d\u03a3",
"output": null
},
{
"comment": "C2; P1; V6",
"input": "\u0756\u3002\u1160\u200d\u03c3",
"output": null
},
{
"comment": "C2; P1; V6",
"input": "\u0756\u3002\u3164\u200d\u03a3",
"output": null
},
{
"comment": "C2; P1; V6",
"input": "\u0756\u3002\u3164\u200d\u03c3",
"output": null
},
{
"comment": "P1; V6",
"input": "\ud83c\udd07\u4f10\ufe12.\ud831\ude5a\ua8c4",
"output": null
},
{
"comment": "P1; V5; V6",
"input": "\ud802\ude3f.\ud83c\udd06\u2014",
"output": null
},
{
"comment": "C2; P1; V5; V6",
"input": "\u1c32\ud83c\udd08\u2f9b\u05a6\uff0e\u200d\uda7e\udd64\u07fd",
"output": null
},
{
"comment": "C2; P1; V5; V6",
"input": "\ud83e\udc9f\ud83c\udd08\u200d\ua84e\uff61\u0f84",
"output": null
},
{
"comment": "P1; V6",
"input": "\udaa5\udeaa\uff61\ud83c\udd02",
"output": null
},
{
"comment": "C2; P1; V6",
"input": "\u186f\u2689\u59f6\ud83c\udd09\uff0e\u06f7\u200d\ud83c\udfaa\u200d",
"output": null
},
{
"comment": "C1; P1; V5; V6",
"input": "\ua67d\u200c\ud87e\uddf5\ud83c\udd06\uff61\u200c\ud804\udc42\u1b01",
"output": null
},
{
"comment": "C1; P1; V5; V6",
"input": "\ua67d\u200c\u9723\ud83c\udd06\uff61\u200c\ud804\udc42\u1b01",
"output": null
},
{
"comment": "C1; P1; V5; V6; V3 (ignored)",
"input": "-\u1897\u200c\ud83c\udd04.\ud805\udf22",
"output": null
}
]
68 changes: 52 additions & 16 deletions test/fixtures/wpt/url/resources/setters_tests.json
Original file line number Diff line number Diff line change
Expand Up @@ -1177,6 +1177,24 @@
"host": "test.invalid",
"hostname": "test.invalid"
}
},
{
"href": "https://test.invalid/",
"new_value": "test/@aaa",
"expected": {
"href": "https://test/",
"host": "test",
"hostname": "test"
}
},
{
"href": "https://test.invalid/",
"new_value": "test/:aaa",
"expected": {
"href": "https://test/",
"host": "test",
"hostname": "test"
}
}
],
"hostname": [
Expand Down Expand Up @@ -1624,6 +1642,24 @@
"host": "test.invalid",
"hostname": "test.invalid"
}
},
{
"href": "https://test.invalid/",
"new_value": "test/@aaa",
"expected": {
"href": "https://test/",
"host": "test",
"hostname": "test"
}
},
{
"href": "https://test.invalid/",
"new_value": "test/:aaa",
"expected": {
"href": "https://test/",
"host": "test",
"hostname": "test"
}
}
],
"port": [
Expand Down Expand Up @@ -2241,38 +2277,38 @@
}
},
{
"comment": "Drop trailing spaces from trailing opaque paths",
"comment": "Trailing spaces and opaque paths",
"href": "data:space ?query",
"new_value": "",
"expected": {
"href": "data:space",
"pathname": "space",
"href": "data:space%20",
"pathname": "space%20",
"search": ""
}
},
{
"href": "sc:space ?query",
"new_value": "",
"expected": {
"href": "sc:space",
"pathname": "space",
"href": "sc:space%20",
"pathname": "space%20",
"search": ""
}
},
{
"comment": "Do not drop trailing spaces from non-trailing opaque paths",
"comment": "Trailing spaces and opaque paths",
"href": "data:space ?query#fragment",
"new_value": "",
"expected": {
"href": "data:space #fragment",
"href": "data:space %20#fragment",
"search": ""
}
},
{
"href": "sc:space ?query#fragment",
"new_value": "",
"expected": {
"href": "sc:space #fragment",
"href": "sc:space %20#fragment",
"search": ""
}
},
Expand Down Expand Up @@ -2429,38 +2465,38 @@
}
},
{
"comment": "Drop trailing spaces from trailing opaque paths",
"comment": "Trailing spaces and opaque paths",
"href": "data:space #fragment",
"new_value": "",
"expected": {
"href": "data:space",
"pathname": "space",
"href": "data:space %20",
"pathname": "space %20",
"hash": ""
}
},
{
"href": "sc:space #fragment",
"new_value": "",
"expected": {
"href": "sc:space",
"pathname": "space",
"href": "sc:space %20",
"pathname": "space %20",
"hash": ""
}
},
{
"comment": "Do not drop trailing spaces from non-trailing opaque paths",
"comment": "Trailing spaces and opaque paths",
"href": "data:space ?query#fragment",
"new_value": "",
"expected": {
"href": "data:space ?query",
"href": "data:space %20?query",
"hash": ""
}
},
{
"href": "sc:space ?query#fragment",
"new_value": "",
"expected": {
"href": "sc:space ?query",
"href": "sc:space %20?query",
"hash": ""
}
},
Expand Down
12 changes: 9 additions & 3 deletions test/fixtures/wpt/url/resources/toascii.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
[
"This contains assorted IDNA tests that IdnaTestV2 might not cover.",
"Feel free to deduplicate with a clear commit message.",
"",
"If the test only applies to the URL Standard's 'domain to ASCII', ",
"and not to TR46's ToASCII, then tag it with `urlStandardOnly`",
{
"comment": "Label with hyphens in 3rd and 4th position",
"input": "aa--",
Expand Down Expand Up @@ -239,19 +242,22 @@
},
{
"input": "www.lookout.net\u2A7480",
"output": null
"output": null,
"urlStandardOnly": true
},
{
"input": "www\u00A0.lookout.net",
"output": null
"output": null,
"urlStandardOnly": true
},
{
"input": "\u1680lookout.net",
"output": null
},
{
"input": "\u001flookout.net",
"output": null
"output": null,
"urlStandardOnly": true
},
{
"input": "look\u06DDout.net",
Expand Down
Loading
Loading