Skip to content

Commit 6194435

Browse files
nodejs-github-bottargos
authored andcommitted
test: update WPT for url to 67880a4eb83ca9aa732eec4b35a1971ff5bf37ff
PR-URL: #55999 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Jason Zhang <xzha4350@gmail.com>
1 parent a37e5fe commit 6194435

17 files changed

+359
-34
lines changed

test/fixtures/wpt/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Last update:
2828
- resource-timing: https://github.com/web-platform-tests/wpt/tree/22d38586d0/resource-timing
2929
- resources: https://github.com/web-platform-tests/wpt/tree/1e140d63ec/resources
3030
- streams: https://github.com/web-platform-tests/wpt/tree/2bd26e124c/streams
31-
- url: https://github.com/web-platform-tests/wpt/tree/6a39784534/url
31+
- url: https://github.com/web-platform-tests/wpt/tree/67880a4eb8/url
3232
- user-timing: https://github.com/web-platform-tests/wpt/tree/5ae85bf826/user-timing
3333
- wasm/jsapi: https://github.com/web-platform-tests/wpt/tree/cde25e7e3c/wasm/jsapi
3434
- wasm/webapi: https://github.com/web-platform-tests/wpt/tree/fd1b23eeaa/wasm/webapi

test/fixtures/wpt/url/META.yml

-1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,4 @@ suggested_reviewers:
33
- mikewest
44
- domenic
55
- annevk
6-
- GPHemsley
76
- TimothyGu

test/fixtures/wpt/url/README.md

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1-
## urltestdata.json
1+
## urltestdata.json / urltestdata-javascript-only.json
22

3-
`resources/urltestdata.json` contains URL parsing tests suitable for any URL parser implementation.
3+
[`resources/urltestdata.json`](resources/urltestdata.json) contains URL parsing tests suitable for any URL parser implementation.
4+
[`resources/urltestdata-javascript-only.json`](resources/urltestdata-javascript-only.json) contains URL parsing tests specifically meant
5+
for JavaScript's `URL()` class as well as other languages accepting non-scalar-value strings.
46

5-
It's used as a source of tests by `a-element.html`, `failure.html`, `url-constructor.any.js`, and
6-
other test files in this directory.
7+
These files are used as a source of tests by `a-element.html`, `failure.html`, `url-constructor.any.js`,
8+
and other test files in this directory.
79

8-
The format of `resources/urltestdata.json` is a JSON array of comments as strings and test cases as
10+
Both files share the same format. They consist of a JSON array of comments as strings and test cases as
911
objects. The keys for each test case are:
1012

1113
* `input`: a string to be parsed as URL.

test/fixtures/wpt/url/a-element-origin-xhtml.xhtml

+5-1
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,8 @@
1212
<script src="resources/a-element-origin.js"></script>
1313
</body>
1414
</html>
15-
<!-- Other dependencies: resources/urltestdata.json -->
15+
<!--
16+
Other dependencies:
17+
* resources/urltestdata.json,
18+
* resources/urltestdata-javascript-only.json,
19+
-->

test/fixtures/wpt/url/a-element-origin.html

+5-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,8 @@
55
<base id=base>
66
<div id=log></div>
77
<script src=resources/a-element-origin.js></script>
8-
<!-- Other dependencies: resources/urltestdata.json -->
8+
<!--
9+
Other dependencies:
10+
* resources/urltestdata.json,
11+
* resources/urltestdata-javascript-only.json,
12+
-->

test/fixtures/wpt/url/a-element-xhtml.xhtml

+5-1
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,8 @@
1717
<script src="resources/a-element.js"></script>
1818
</body>
1919
</html>
20-
<!-- Other dependencies: resources/urltestdata.json -->
20+
<!--
21+
Other dependencies:
22+
* resources/urltestdata.json,
23+
* resources/urltestdata-javascript-only.json,
24+
-->

test/fixtures/wpt/url/a-element.html

+5-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@
1010
<base id=base>
1111
<div id=log></div>
1212
<script src=resources/a-element.js></script>
13-
<!-- Other dependencies: resources/urltestdata.json -->
13+
<!--
14+
Other dependencies:
15+
* resources/urltestdata.json,
16+
* resources/urltestdata-javascript-only.json,
17+
-->
1418

1519

1620
<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>

test/fixtures/wpt/url/failure.html

+4-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@
66
<script src=/resources/testharnessreport.js></script>
77
<div id=log></div>
88
<script>
9-
promise_test(() => fetch("resources/urltestdata.json").then(res => res.json()).then(runTests), "Loading data…")
9+
promise_test(() => Promise.all([
10+
fetch("resources/urltestdata.json").then(res => res.json()),
11+
fetch("resources/urltestdata-javascript-only.json").then(res => res.json()),
12+
]).then((tests) => tests.flat()).then(runTests), "Loading data…");
1013

1114
function runTests(testData) {
1215
for (const test of testData) {

test/fixtures/wpt/url/idlharness-shadowrealm.window.js

-2
This file was deleted.

test/fixtures/wpt/url/idlharness.any.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// META: script=/resources/WebIDLParser.js
22
// META: script=/resources/idlharness.js
3+
// META: global=window,dedicatedworker,shadowrealm-in-window
34

45
idl_test(
56
['url'],

test/fixtures/wpt/url/resources/a-element-origin.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
promise_test(() => fetch("resources/urltestdata.json").then(res => res.json()).then(runURLTests), "Loading data…");
1+
promise_test(() => Promise.all([
2+
fetch("resources/urltestdata.json").then(res => res.json()),
3+
fetch("resources/urltestdata-javascript-only.json").then(res => res.json()),
4+
]).then((tests) => tests.flat()).then(runURLTests), "Loading data…");
25

36
function setBase(base) {
47
document.getElementById("base").href = base

test/fixtures/wpt/url/resources/a-element.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
promise_test(() => fetch("resources/urltestdata.json").then(res => res.json()).then(runURLTests), "Loading data…");
1+
promise_test(() => Promise.all([
2+
fetch("resources/urltestdata.json").then(res => res.json()),
3+
fetch("resources/urltestdata-javascript-only.json").then(res => res.json()),
4+
]).then((tests) => tests.flat()).then(runURLTests), "Loading data…");
25

36
function setBase(base) {
47
document.getElementById("base").href = base;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[
2+
"See ../README.md for a description of the format.",
3+
{
4+
"input": "http://example.com/\uD800\uD801\uDFFE\uDFFF\uFDD0\uFDCF\uFDEF\uFDF0\uFFFE\uFFFF?\uD800\uD801\uDFFE\uDFFF\uFDD0\uFDCF\uFDEF\uFDF0\uFFFE\uFFFF",
5+
"base": null,
6+
"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",
7+
"origin": "http://example.com",
8+
"protocol": "http:",
9+
"username": "",
10+
"password": "",
11+
"host": "example.com",
12+
"hostname": "example.com",
13+
"port": "",
14+
"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",
15+
"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",
16+
"hash": ""
17+
}
18+
]

0 commit comments

Comments
 (0)