test: update WPT for url to 67880a4eb83ca9aa732eec4b35a1971ff5bf37ff

PR-URL: https://github.com/nodejs/node/pull/55999
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Jason Zhang <xzha4350@gmail.com>
This commit is contained in:
Node.js GitHub Bot authored and Ruy Adorno committed 2025-01-05 12:57:30 -05:00
1 parent 3a55bd9448
commit c52bc5d71c
17 files changed
+359 -34

No files matched your search

+1 -1
View File
@@ -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/2bd26e124c/streams
- url: https://github.com/web-platform-tests/wpt/tree/6a39784534/url
- url: https://github.com/web-platform-tests/wpt/tree/67880a4eb8/url
- 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
- wasm/webapi: https://github.com/web-platform-tests/wpt/tree/fd1b23eeaa/wasm/webapi
-1
View File
@@ -3,5 +3,4 @@ suggested_reviewers:
- mikewest
- domenic
- annevk
- GPHemsley
- TimothyGu
+7 -5
View File
@@ -1,11 +1,13 @@
## urltestdata.json
## urltestdata.json / urltestdata-javascript-only.json
`resources/urltestdata.json` contains URL parsing tests suitable for any URL parser implementation.
[`resources/urltestdata.json`](resources/urltestdata.json) contains URL parsing tests suitable for any URL parser implementation.
[`resources/urltestdata-javascript-only.json`](resources/urltestdata-javascript-only.json) contains URL parsing tests specifically meant
for JavaScript's `URL()` class as well as other languages accepting non-scalar-value strings.
It's used as a source of tests by `a-element.html`, `failure.html`, `url-constructor.any.js`, and
other test files in this directory.
These files are used as a source of tests by `a-element.html`, `failure.html`, `url-constructor.any.js`,
and other test files in this directory.
The format of `resources/urltestdata.json` is a JSON array of comments as strings and test cases as
Both files share the same format. They consist of a JSON array of comments as strings and test cases as
objects. The keys for each test case are:
* `input`: a string to be parsed as URL.
+5 -1
View File
@@ -12,4 +12,8 @@
<script src="resources/a-element-origin.js"></script>
</body>
</html>
<!-- Other dependencies: resources/urltestdata.json -->
<!--
Other dependencies:
* resources/urltestdata.json,
* resources/urltestdata-javascript-only.json,
-->
+5 -1
View File
@@ -5,4 +5,8 @@
<base id=base>
<div id=log></div>
<script src=resources/a-element-origin.js></script>
<!-- Other dependencies: resources/urltestdata.json -->
<!--
Other dependencies:
* resources/urltestdata.json,
* resources/urltestdata-javascript-only.json,
-->
+5 -1
View File
@@ -17,4 +17,8 @@
<script src="resources/a-element.js"></script>
</body>
</html>
<!-- Other dependencies: resources/urltestdata.json -->
<!--
Other dependencies:
* resources/urltestdata.json,
* resources/urltestdata-javascript-only.json,
-->
+5 -1
View File
@@ -10,7 +10,11 @@
<base id=base>
<div id=log></div>
<script src=resources/a-element.js></script>
<!-- Other dependencies: resources/urltestdata.json -->
<!--
Other dependencies:
* resources/urltestdata.json,
* resources/urltestdata-javascript-only.json,
-->
<a id="multline-entity" download="multline-entity.txt" href="data:text/plain;charset=utf-8,first%20line&#10;second%20line"> Link with embedded \n is parsed correctly </a>
+4 -1
View File
@@ -6,7 +6,10 @@
<script src=/resources/testharnessreport.js></script>
<div id=log></div>
<script>
promise_test(() => fetch("resources/urltestdata.json").then(res => res.json()).then(runTests), "Loading data…")
promise_test(() => Promise.all([
fetch("resources/urltestdata.json").then(res => res.json()),
fetch("resources/urltestdata-javascript-only.json").then(res => res.json()),
]).then((tests) => tests.flat()).then(runTests), "Loading data…");
function runTests(testData) {
for (const test of testData) {
@@ -1,2 +0,0 @@
// META: script=/resources/idlharness-shadowrealm.js
idl_test_shadowrealm(["url"], []);
+1
View File
@@ -1,5 +1,6 @@
// META: script=/resources/WebIDLParser.js
// META: script=/resources/idlharness.js
// META: global=window,dedicatedworker,shadowrealm-in-window
idl_test(
['url'],
+4 -1
View File
@@ -1,4 +1,7 @@
promise_test(() => fetch("resources/urltestdata.json").then(res => res.json()).then(runURLTests), "Loading data…");
promise_test(() => Promise.all([
fetch("resources/urltestdata.json").then(res => res.json()),
fetch("resources/urltestdata-javascript-only.json").then(res => res.json()),
]).then((tests) => tests.flat()).then(runURLTests), "Loading data…");
function setBase(base) {
document.getElementById("base").href = base
+4 -1
View File
@@ -1,4 +1,7 @@
promise_test(() => fetch("resources/urltestdata.json").then(res => res.json()).then(runURLTests), "Loading data…");
promise_test(() => Promise.all([
fetch("resources/urltestdata.json").then(res => res.json()),
fetch("resources/urltestdata-javascript-only.json").then(res => res.json()),
]).then((tests) => tests.flat()).then(runURLTests), "Loading data…");
function setBase(base) {
document.getElementById("base").href = base;
@@ -0,0 +1,18 @@
[
"See ../README.md for a description of the format.",
{
"input": "http://example.com/\uD800\uD801\uDFFE\uDFFF\uFDD0\uFDCF\uFDEF\uFDF0\uFFFE\uFFFF?\uD800\uD801\uDFFE\uDFFF\uFDD0\uFDCF\uFDEF\uFDF0\uFFFE\uFFFF",
"base": null,
"href": "http://example.com/%EF%BF%BD%F0%90%9F%BE%EF%BF%BD%EF%B7%90%EF%B7%8F%EF%B7%AF%EF%B7%B0%EF%BF%BE%EF%BF%BF?%EF%BF%BD%F0%90%9F%BE%EF%BF%BD%EF%B7%90%EF%B7%8F%EF%B7%AF%EF%B7%B0%EF%BF%BE%EF%BF%BF",
"origin": "http://example.com",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.com",
"hostname": "example.com",
"port": "",
"pathname": "/%EF%BF%BD%F0%90%9F%BE%EF%BF%BD%EF%B7%90%EF%B7%8F%EF%B7%AF%EF%B7%B0%EF%BF%BE%EF%BF%BF",
"search": "?%EF%BF%BD%F0%90%9F%BE%EF%BF%BD%EF%B7%90%EF%B7%8F%EF%B7%AF%EF%B7%B0%EF%BF%BE%EF%BF%BF",
"hash": ""
}
]
+291 -15
View File
@@ -4849,21 +4849,6 @@
"search": "",
"hash": ""
},
{
"input": "http://example.com/\uD800\uD801\uDFFE\uDFFF\uFDD0\uFDCF\uFDEF\uFDF0\uFFFE\uFFFF?\uD800\uD801\uDFFE\uDFFF\uFDD0\uFDCF\uFDEF\uFDF0\uFFFE\uFFFF",
"base": null,
"href": "http://example.com/%EF%BF%BD%F0%90%9F%BE%EF%BF%BD%EF%B7%90%EF%B7%8F%EF%B7%AF%EF%B7%B0%EF%BF%BE%EF%BF%BF?%EF%BF%BD%F0%90%9F%BE%EF%BF%BD%EF%B7%90%EF%B7%8F%EF%B7%AF%EF%B7%B0%EF%BF%BE%EF%BF%BF",
"origin": "http://example.com",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.com",
"hostname": "example.com",
"port": "",
"pathname": "/%EF%BF%BD%F0%90%9F%BE%EF%BF%BD%EF%B7%90%EF%B7%8F%EF%B7%AF%EF%B7%B0%EF%BF%BE%EF%BF%BF",
"search": "?%EF%BF%BD%F0%90%9F%BE%EF%BF%BD%EF%B7%90%EF%B7%8F%EF%B7%AF%EF%B7%B0%EF%BF%BE%EF%BF%BF",
"hash": ""
},
"Forbidden host code points",
{
"input": "sc://a\u0000b/",
@@ -9658,6 +9643,201 @@
"search": "",
"hash": ""
},
{
"input": "android://x:0/a",
"base": null,
"href": "android://x:0/a",
"origin": "null",
"protocol": "android:",
"username": "",
"password": "",
"host": "x:0",
"hostname": "x",
"port": "0",
"pathname": "/a",
"search": "",
"hash": ""
},
{
"input": "drivefs://x:0/a",
"base": null,
"href": "drivefs://x:0/a",
"origin": "null",
"protocol": "drivefs:",
"username": "",
"password": "",
"host": "x:0",
"hostname": "x",
"port": "0",
"pathname": "/a",
"search": "",
"hash": ""
},
{
"input": "chromeos-steam://x:0/a",
"base": null,
"href": "chromeos-steam://x:0/a",
"origin": "null",
"protocol": "chromeos-steam:",
"username": "",
"password": "",
"host": "x:0",
"hostname": "x",
"port": "0",
"pathname": "/a",
"search": "",
"hash": ""
},
{
"input": "steam://x:0/a",
"base": null,
"href": "steam://x:0/a",
"origin": "null",
"protocol": "steam:",
"username": "",
"password": "",
"host": "x:0",
"hostname": "x",
"port": "0",
"pathname": "/a",
"search": "",
"hash": ""
},
{
"input": "materialized-view://x:0/a",
"base": null,
"href": "materialized-view://x:0/a",
"origin": "null",
"protocol": "materialized-view:",
"username": "",
"password": "",
"host": "x:0",
"hostname": "x",
"port": "0",
"pathname": "/a",
"search": "",
"hash": ""
},
{
"input": "android-app://x:0",
"base": null,
"href": "android-app://x:0",
"origin": "null",
"protocol": "android-app:",
"username": "",
"password": "",
"host": "x:0",
"hostname": "x",
"port": "0",
"pathname": "",
"search": "",
"hash": ""
},
{
"input": "chrome-distiller://x:0",
"base": null,
"href": "chrome-distiller://x:0",
"origin": "null",
"protocol": "chrome-distiller:",
"username": "",
"password": "",
"host": "x:0",
"hostname": "x",
"port": "0",
"pathname": "",
"search": "",
"hash": ""
},
{
"input": "chrome-extension://x:0",
"base": null,
"href": "chrome-extension://x:0",
"origin": "null",
"protocol": "chrome-extension:",
"username": "",
"password": "",
"host": "x:0",
"hostname": "x",
"port": "0",
"pathname": "",
"search": "",
"hash": ""
},
{
"input": "chrome-native://x:0",
"base": null,
"href": "chrome-native://x:0",
"origin": "null",
"protocol": "chrome-native:",
"username": "",
"password": "",
"host": "x:0",
"hostname": "x",
"port": "0",
"pathname": "",
"search": "",
"hash": ""
},
{
"input": "chrome-resource://x:0",
"base": null,
"href": "chrome-resource://x:0",
"origin": "null",
"protocol": "chrome-resource:",
"username": "",
"password": "",
"host": "x:0",
"hostname": "x",
"port": "0",
"pathname": "",
"search": "",
"hash": ""
},
{
"input": "chrome-search://x:0",
"base": null,
"href": "chrome-search://x:0",
"origin": "null",
"protocol": "chrome-search:",
"username": "",
"password": "",
"host": "x:0",
"hostname": "x",
"port": "0",
"pathname": "",
"search": "",
"hash": ""
},
{
"input": "fuchsia-dir://x:0",
"base": null,
"href": "fuchsia-dir://x:0",
"origin": "null",
"protocol": "fuchsia-dir:",
"username": "",
"password": "",
"host": "x:0",
"hostname": "x",
"port": "0",
"pathname": "",
"search": "",
"hash": ""
},
{
"input": "isolated-app://x:0",
"base": null,
"href": "isolated-app://x:0",
"origin": "null",
"protocol": "isolated-app:",
"username": "",
"password": "",
"host": "x:0",
"hostname": "x",
"port": "0",
"pathname": "",
"search": "",
"hash": ""
},
"Scheme relative path starting with multiple slashes",
{
"input": "///test",
@@ -9812,5 +9992,101 @@
"pathname": "/",
"search": "",
"hash": ""
},
"# Non-special URL and backslashes",
{
"input": "non-special:\\\\opaque",
"base": null,
"href": "non-special:\\\\opaque",
"origin": "null",
"protocol": "non-special:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "\\\\opaque",
"search": "",
"hash": ""
},
{
"input": "non-special:\\\\opaque/path",
"base": null,
"href": "non-special:\\\\opaque/path",
"origin": "null",
"protocol": "non-special:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "\\\\opaque/path",
"search": "",
"hash": ""
},
{
"input": "non-special:\\\\opaque\\path",
"base": null,
"href": "non-special:\\\\opaque\\path",
"origin": "null",
"protocol": "non-special:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "\\\\opaque\\path",
"search": "",
"hash": ""
},
{
"input": "non-special:\\/opaque",
"base": null,
"href": "non-special:\\/opaque",
"origin": "null",
"protocol": "non-special:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "\\/opaque",
"search": "",
"hash": ""
},
{
"input": "non-special:/\\path",
"base": null,
"href": "non-special:/\\path",
"origin": "null",
"protocol": "non-special:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/\\path",
"search": "",
"hash": ""
},
{
"input": "non-special://host\\a",
"base": null,
"failure": true
},
{
"input": "non-special://host/a\\b",
"base": null,
"href": "non-special://host/a\\b",
"origin": "null",
"protocol": "non-special:",
"username": "",
"password": "",
"host": "host",
"hostname": "host",
"port": "",
"pathname": "/a\\b",
"search": "",
"hash": ""
}
]
+4 -1
View File
@@ -50,4 +50,7 @@ function runURLTests(urlTests) {
}
}
promise_test(() => fetch("resources/urltestdata.json").then(res => res.json()).then(runURLTests), "Loading data…");
promise_test(() => Promise.all([
fetch("resources/urltestdata.json").then(res => res.json()),
fetch("resources/urltestdata-javascript-only.json").then(res => res.json()),
]).then((tests) => tests.flat()).then(runURLTests), "Loading data…");
+4 -1
View File
@@ -1,4 +1,7 @@
promise_test(() => fetch("resources/urltestdata.json").then(res => res.json()).then(runURLTests), "Loading data…");
promise_test(() => Promise.all([
fetch("resources/urltestdata.json").then(res => res.json()),
fetch("resources/urltestdata-javascript-only.json").then(res => res.json()),
]).then((tests) => tests.flat()).then(runURLTests), "Loading data…");
function runURLTests(urlTests) {
for (const expected of urlTests) {
+1 -1
View File
@@ -72,7 +72,7 @@
"path": "streams"
},
"url": {
"commit": "6a39784534e118acc102cf5252c542378831401d",
"commit": "67880a4eb83ca9aa732eec4b35a1971ff5bf37ff",
"path": "url"
},
"user-timing": {