From c5579ea197e83d5f8496bcd14533e33d1401316c Mon Sep 17 00:00:00 2001 From: "Node.js GitHub Bot" Date: Thu, 28 Nov 2024 08:55:51 -0500 Subject: [PATCH] test: update WPT for url to 67880a4eb83ca9aa732eec4b35a1971ff5bf37ff PR-URL: https://github.com/nodejs/node/pull/55999 Reviewed-By: Yagiz Nizipli Reviewed-By: Jason Zhang --- test/fixtures/wpt/README.md | 2 +- test/fixtures/wpt/url/META.yml | 1 - test/fixtures/wpt/url/README.md | 12 +- .../wpt/url/a-element-origin-xhtml.xhtml | 6 +- test/fixtures/wpt/url/a-element-origin.html | 6 +- test/fixtures/wpt/url/a-element-xhtml.xhtml | 6 +- test/fixtures/wpt/url/a-element.html | 6 +- test/fixtures/wpt/url/failure.html | 5 +- .../wpt/url/idlharness-shadowrealm.window.js | 2 - test/fixtures/wpt/url/idlharness.any.js | 1 + .../wpt/url/resources/a-element-origin.js | 5 +- test/fixtures/wpt/url/resources/a-element.js | 5 +- .../urltestdata-javascript-only.json | 18 ++ .../wpt/url/resources/urltestdata.json | 306 +++++++++++++++++- test/fixtures/wpt/url/url-constructor.any.js | 5 +- test/fixtures/wpt/url/url-origin.any.js | 5 +- test/fixtures/wpt/versions.json | 2 +- 17 files changed, 359 insertions(+), 34 deletions(-) delete mode 100644 test/fixtures/wpt/url/idlharness-shadowrealm.window.js create mode 100644 test/fixtures/wpt/url/resources/urltestdata-javascript-only.json diff --git a/test/fixtures/wpt/README.md b/test/fixtures/wpt/README.md index 68eebc09e7b1ab..86d83e913e6ed4 100644 --- a/test/fixtures/wpt/README.md +++ b/test/fixtures/wpt/README.md @@ -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 diff --git a/test/fixtures/wpt/url/META.yml b/test/fixtures/wpt/url/META.yml index 094b266b64b61b..415bd0f094c6b9 100644 --- a/test/fixtures/wpt/url/META.yml +++ b/test/fixtures/wpt/url/META.yml @@ -3,5 +3,4 @@ suggested_reviewers: - mikewest - domenic - annevk - - GPHemsley - TimothyGu diff --git a/test/fixtures/wpt/url/README.md b/test/fixtures/wpt/url/README.md index fa5e3b0dc72385..50227bc4b330ef 100644 --- a/test/fixtures/wpt/url/README.md +++ b/test/fixtures/wpt/url/README.md @@ -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. diff --git a/test/fixtures/wpt/url/a-element-origin-xhtml.xhtml b/test/fixtures/wpt/url/a-element-origin-xhtml.xhtml index effcf04bee3fb0..e68e68dda2ad6c 100644 --- a/test/fixtures/wpt/url/a-element-origin-xhtml.xhtml +++ b/test/fixtures/wpt/url/a-element-origin-xhtml.xhtml @@ -12,4 +12,8 @@ - + diff --git a/test/fixtures/wpt/url/a-element-origin.html b/test/fixtures/wpt/url/a-element-origin.html index 9cc8e94cbed060..7015f853f01a1d 100644 --- a/test/fixtures/wpt/url/a-element-origin.html +++ b/test/fixtures/wpt/url/a-element-origin.html @@ -5,4 +5,8 @@
- + diff --git a/test/fixtures/wpt/url/a-element-xhtml.xhtml b/test/fixtures/wpt/url/a-element-xhtml.xhtml index 05bec4ce4b2f1e..610481a7819d62 100644 --- a/test/fixtures/wpt/url/a-element-xhtml.xhtml +++ b/test/fixtures/wpt/url/a-element-xhtml.xhtml @@ -17,4 +17,8 @@ - + diff --git a/test/fixtures/wpt/url/a-element.html b/test/fixtures/wpt/url/a-element.html index 3428fa00574c4d..a7621d2ded76c4 100644 --- a/test/fixtures/wpt/url/a-element.html +++ b/test/fixtures/wpt/url/a-element.html @@ -10,7 +10,11 @@
- + Link with embedded \n is parsed correctly diff --git a/test/fixtures/wpt/url/failure.html b/test/fixtures/wpt/url/failure.html index e61f462f97456f..d95b1d52d67237 100644 --- a/test/fixtures/wpt/url/failure.html +++ b/test/fixtures/wpt/url/failure.html @@ -6,7 +6,10 @@