GeezerVison is showing github.com — test: update `url` web platform tests · nodejs/node@465ad2a
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: test/fixtures/wpt/README.md +1-1Lines changed: 1 addition & 1 deletion - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -27,7 +27,7 @@ Last update: | 27 | 27 | - resource-timing: https://github.com/web-platform-tests/wpt/tree/22d38586d0/resource-timing | 28 | 28 | - resources: https://github.com/web-platform-tests/wpt/tree/919874f84f/resources | 29 | 29 | - streams: https://github.com/web-platform-tests/wpt/tree/517e945bbf/streams | 30 | | -- url: https://github.com/web-platform-tests/wpt/tree/84782d9315/url | | 30 | +- url: https://github.com/web-platform-tests/wpt/tree/c2d7e70b52/url | 31 | 31 | - user-timing: https://github.com/web-platform-tests/wpt/tree/5ae85bf826/user-timing | 32 | 32 | - wasm/jsapi: https://github.com/web-platform-tests/wpt/tree/cde25e7e3c/wasm/jsapi | 33 | 33 | - wasm/webapi: https://github.com/web-platform-tests/wpt/tree/fd1b23eeaa/wasm/webapi | |
Collapse file Copy file name to clipboardExpand all lines: test/fixtures/wpt/url/failure.html +2Lines changed: 2 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 10 | 10 |
| 11 | 11 | function runTests(testData) { | 12 | 12 | for (const test of testData) { | | 13 | + | | 14 | + // skip comments, inputs we expect to pass and relative URLs | 13 | 15 | if (typeof test === "string" || !test.failure || test.base !== null) { | 14 | 16 | continue; | 15 | 17 | } | |
Collapse file Copy file name to clipboardExpand all lines: test/fixtures/wpt/url/resources/a-element-origin.js +4Lines changed: 4 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -21,6 +21,10 @@ function runURLTests(urlTests) { | 21 | 21 | if (expected.base === null && expected.input.startsWith("#")) | 22 | 22 | continue; | 23 | 23 |
| | 24 | + // HTML special cases data: and javascript: URLs in <base> | | 25 | + if (expected.base !== null && (expected.base.startsWith("data:") || expected.base.startsWith("javascript:"))) | | 26 | + continue; | | 27 | + | 24 | 28 | // We cannot use a null base for HTML tests | 25 | 29 | const base = expected.base === null ? "about:blank" : expected.base; | 26 | 30 |
| |
Collapse file Copy file name to clipboardExpand all lines: test/fixtures/wpt/url/resources/a-element.js +4Lines changed: 4 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -21,6 +21,10 @@ function runURLTests(urlTests) { | 21 | 21 | if (expected.relativeTo === "any-base") | 22 | 22 | continue; | 23 | 23 |
| | 24 | + // HTML special cases data: and javascript: URLs in <base> | | 25 | + if (expected.base !== null && (expected.base.startsWith("data:") || expected.base.startsWith("javascript:"))) | | 26 | + continue; | | 27 | + | 24 | 28 | // We cannot use a null base for HTML tests | 25 | 29 | const base = expected.base === null ? "about:blank" : expected.base; | 26 | 30 |
| |
Collapse file Copy file name to clipboardExpand all lines: test/fixtures/wpt/url/resources/setters_tests.json +54Lines changed: 54 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 2021 | 2021 | "href": "sc:/space%20", | 2022 | 2022 | "pathname": "/space%20" | 2023 | 2023 | } | | 2024 | + }, | | 2025 | + { | | 2026 | + "comment": "Trailing space should be encoded", | | 2027 | + "href": "http://example.net", | | 2028 | + "new_value": " ", | | 2029 | + "expected": { | | 2030 | + "href": "http://example.net/%20", | | 2031 | + "pathname": "/%20" | | 2032 | + } | | 2033 | + }, | | 2034 | + { | | 2035 | + "comment": "Trailing C0 control should be encoded", | | 2036 | + "href": "http://example.net", | | 2037 | + "new_value": "\u0000", | | 2038 | + "expected": { | | 2039 | + "href": "http://example.net/%00", | | 2040 | + "pathname": "/%00" | | 2041 | + } | 2024 | 2042 | } | 2025 | 2043 | ], | 2026 | 2044 | "search": [ | | 2141 | 2159 | "href": "sc:space #fragment", | 2142 | 2160 | "search": "" | 2143 | 2161 | } | | 2162 | + }, | | 2163 | + { | | 2164 | + "comment": "Trailing space should be encoded", | | 2165 | + "href": "http://example.net", | | 2166 | + "new_value": " ", | | 2167 | + "expected": { | | 2168 | + "href": "http://example.net/?%20", | | 2169 | + "search": "?%20" | | 2170 | + } | | 2171 | + }, | | 2172 | + { | | 2173 | + "comment": "Trailing C0 control should be encoded", | | 2174 | + "href": "http://example.net", | | 2175 | + "new_value": "\u0000", | | 2176 | + "expected": { | | 2177 | + "href": "http://example.net/?%00", | | 2178 | + "search": "?%00" | | 2179 | + } | 2144 | 2180 | } | 2145 | 2181 | ], | 2146 | 2182 | "hash": [ | | 2311 | 2347 | "href": "sc:space ?query", | 2312 | 2348 | "hash": "" | 2313 | 2349 | } | | 2350 | + }, | | 2351 | + { | | 2352 | + "comment": "Trailing space should be encoded", | | 2353 | + "href": "http://example.net", | | 2354 | + "new_value": " ", | | 2355 | + "expected": { | | 2356 | + "href": "http://example.net/#%20", | | 2357 | + "hash": "#%20" | | 2358 | + } | | 2359 | + }, | | 2360 | + { | | 2361 | + "comment": "Trailing C0 control should be encoded", | | 2362 | + "href": "http://example.net", | | 2363 | + "new_value": "\u0000", | | 2364 | + "expected": { | | 2365 | + "href": "http://example.net/#%00", | | 2366 | + "hash": "#%00" | | 2367 | + } | 2314 | 2368 | } | 2315 | 2369 | ], | 2316 | 2370 | "href": [ | |
Collapse file Copy file name to clipboardExpand all lines: test/fixtures/wpt/url/resources/urltestdata.json -1Lines changed: 0 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 7851 | 7851 | "input": "blob:file://host/path", | 7852 | 7852 | "base": null, | 7853 | 7853 | "href": "blob:file://host/path", | 7854 | | - "origin": "null", | 7855 | 7854 | "protocol": "blob:", | 7856 | 7855 | "username": "", | 7857 | 7856 | "password": "", | |
Collapse file Copy file name to clipboardExpand all lines: test/fixtures/wpt/url/url-statics-canparse.any.js +4-4Lines changed: 4 additions & 4 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 6 | 6 | "expected": false | 7 | 7 | }, | 8 | 8 | { | 9 | | - "url": "a:b", | | 9 | + "url": "aaa:b", | 10 | 10 | "base": undefined, | 11 | 11 | "expected": true | 12 | 12 | }, | 13 | 13 | { | 14 | 14 | "url": undefined, | 15 | | - "base": "a:b", | | 15 | + "base": "aaa:b", | 16 | 16 | "expected": false | 17 | 17 | }, | 18 | 18 | { | 19 | | - "url": "a:/b", | | 19 | + "url": "aaa:/b", | 20 | 20 | "base": undefined, | 21 | 21 | "expected": true | 22 | 22 | }, | 23 | 23 | { | 24 | 24 | "url": undefined, | 25 | | - "base": "a:/b", | | 25 | + "base": "aaa:/b", | 26 | 26 | "expected": true | 27 | 27 | }, | 28 | 28 | { | |
Collapse file Copy file name to clipboardExpand all lines: test/fixtures/wpt/url/urlsearchparams-delete.any.js +11Lines changed: 11 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -70,3 +70,14 @@ test(() => { | 70 | 70 | params.delete('a', 'c'); | 71 | 71 | assert_equals(params.toString(), 'a=b&a=d'); | 72 | 72 | }, "Two-argument delete()"); | | 73 | + | | 74 | +test(() => { | | 75 | + const params = new URLSearchParams(); | | 76 | + params.append('a', 'b'); | | 77 | + params.append('a', 'c'); | | 78 | + params.append('b', 'c'); | | 79 | + params.append('b', 'd'); | | 80 | + params.delete('b', 'c'); | | 81 | + params.delete('a', undefined); | | 82 | + assert_equals(params.toString(), 'b=d'); | | 83 | +}, "Two-argument delete() respects undefined as second arg"); |
Collapse file Copy file name to clipboardExpand all lines: test/fixtures/wpt/url/urlsearchparams-has.any.js +8Lines changed: 8 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -35,3 +35,11 @@ test(() => { | 35 | 35 | params.delete('a', 'b'); | 36 | 36 | assert_true(params.has('a', 'd')); | 37 | 37 | }, "Two-argument has()"); | | 38 | + | | 39 | +test(() => { | | 40 | + const params = new URLSearchParams("a=b&a=d&c&e&"); | | 41 | + assert_true(params.has('a', 'b')); | | 42 | + assert_false(params.has('a', 'c')); | | 43 | + assert_true(params.has('a', 'd')); | | 44 | + assert_true(params.has('a', undefined)); | | 45 | +}, "Two-argument has() respects undefined as second arg"); |
Collapse file Copy file name to clipboardExpand all lines: test/fixtures/wpt/versions.json +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 68 | 68 | "path": "streams" | 69 | 69 | }, | 70 | 70 | "url": { | 71 | | - "commit": "84782d931516aa13cfe32dc7eaa1377b4d947d66", | | 71 | + "commit": "c2d7e70b52cbd9a5b938aa32f37078d7a71e0b21", | 72 | 72 | "path": "url" | 73 | 73 | }, | 74 | 74 | "user-timing": { | |
|