Skip to content

Commit d2c169a

Browse files
anonrigtargos
authored andcommitted
test: update url web-platform tests
PR-URL: #53472 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Filip Skokan <[email protected]> Reviewed-By: Chemi Atlow <[email protected]> Reviewed-By: Moshe Atlow <[email protected]> Reviewed-By: Tobias Nießen <[email protected]>
1 parent a502638 commit d2c169a

File tree

6 files changed

+158
-2
lines changed

6 files changed

+158
-2
lines changed

test/fixtures/wpt/README.md

Lines changed: 1 addition & 1 deletion
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/9b03282a99/streams
31-
- url: https://github.com/web-platform-tests/wpt/tree/0f550ab9f5/url
31+
- url: https://github.com/web-platform-tests/wpt/tree/7f369fef2b/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
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
features:
2+
- name: url-canparse
3+
files:
4+
- url-statics-canparse.*

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,13 @@
1111
<div id=log></div>
1212
<script src=resources/a-element.js></script>
1313
<!-- Other dependencies: resources/urltestdata.json -->
14+
15+
16+
<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>
17+
18+
<script type="text/javascript">
19+
test(function() {
20+
const link = document.getElementById("multline-entity");
21+
assert_equals(link.href, "data:text/plain;charset=utf-8,first%20linesecond%20line");
22+
}, "Test that embedded 0x0A is stripped");
23+
</script>

test/fixtures/wpt/url/resources/setters_tests.json

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -825,6 +825,17 @@
825825
"port": ""
826826
}
827827
},
828+
{
829+
"comment": "Stuff after a ? delimiter is ignored, trailing 'port'",
830+
"href": "http://example.net/path",
831+
"new_value": "example.com?stuff:8080",
832+
"expected": {
833+
"href": "http://example.com/path",
834+
"host": "example.com",
835+
"hostname": "example.com",
836+
"port": ""
837+
}
838+
},
828839
{
829840
"comment": "Stuff after a ? delimiter is ignored",
830841
"href": "http://example.net/path",
@@ -924,6 +935,39 @@
924935
"port": "8080"
925936
}
926937
},
938+
{
939+
"comment": "Anything other than ASCII digit stops the port parser in a setter but is not an error",
940+
"href": "http://example.net:8080",
941+
"new_value": "example.com:invalid",
942+
"expected": {
943+
"href": "http://example.com:8080/",
944+
"host": "example.com:8080",
945+
"hostname": "example.com",
946+
"port": "8080"
947+
}
948+
},
949+
{
950+
"comment": "Anything other than ASCII digit stops the port parser in a setter but is not an error",
951+
"href": "http://example.net:8080/test",
952+
"new_value": "[::1]:invalid",
953+
"expected": {
954+
"href": "http://[::1]:8080/test",
955+
"host": "[::1]:8080",
956+
"hostname": "[::1]",
957+
"port": "8080"
958+
}
959+
},
960+
{
961+
"comment": "IPv6 without port",
962+
"href": "http://example.net:8080/test",
963+
"new_value": "[::1]",
964+
"expected": {
965+
"href": "http://[::1]:8080/test",
966+
"host": "[::1]:8080",
967+
"hostname": "[::1]",
968+
"port": "8080"
969+
}
970+
},
927971
{
928972
"comment": "Port numbers are 16 bit integers",
929973
"href": "http://example.net/path",

test/fixtures/wpt/url/resources/urltestdata.json

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1781,6 +1781,76 @@
17811781
"search": "",
17821782
"hash": ""
17831783
},
1784+
{
1785+
"input": "file:///w|m",
1786+
"base": null,
1787+
"href": "file:///w|m",
1788+
"protocol": "file:",
1789+
"username": "",
1790+
"password": "",
1791+
"host": "",
1792+
"hostname": "",
1793+
"port": "",
1794+
"pathname": "/w|m",
1795+
"search": "",
1796+
"hash": ""
1797+
},
1798+
{
1799+
"input": "file:///w||m",
1800+
"base": null,
1801+
"href": "file:///w||m",
1802+
"protocol": "file:",
1803+
"username": "",
1804+
"password": "",
1805+
"host": "",
1806+
"hostname": "",
1807+
"port": "",
1808+
"pathname": "/w||m",
1809+
"search": "",
1810+
"hash": ""
1811+
},
1812+
{
1813+
"input": "file:///w|/m",
1814+
"base": null,
1815+
"href": "file:///w:/m",
1816+
"protocol": "file:",
1817+
"username": "",
1818+
"password": "",
1819+
"host": "",
1820+
"hostname": "",
1821+
"port": "",
1822+
"pathname": "/w:/m",
1823+
"search": "",
1824+
"hash": ""
1825+
},
1826+
{
1827+
"input": "file:C|/m/",
1828+
"base": null,
1829+
"href": "file:///C:/m/",
1830+
"protocol": "file:",
1831+
"username": "",
1832+
"password": "",
1833+
"host": "",
1834+
"hostname": "",
1835+
"port": "",
1836+
"pathname": "/C:/m/",
1837+
"search": "",
1838+
"hash": ""
1839+
},
1840+
{
1841+
"input": "file:C||/m/",
1842+
"base": null,
1843+
"href": "file:///C||/m/",
1844+
"protocol": "file:",
1845+
"username": "",
1846+
"password": "",
1847+
"host": "",
1848+
"hostname": "",
1849+
"port": "",
1850+
"pathname": "/C||/m/",
1851+
"search": "",
1852+
"hash": ""
1853+
},
17841854
"# Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/script-tests/path.js",
17851855
{
17861856
"input": "http://example.com/././foo",
@@ -3590,6 +3660,34 @@
35903660
"search": "",
35913661
"hash": ""
35923662
},
3663+
{
3664+
"input": "file:.",
3665+
"base": null,
3666+
"href": "file:///",
3667+
"protocol": "file:",
3668+
"username": "",
3669+
"password": "",
3670+
"host": "",
3671+
"hostname": "",
3672+
"port": "",
3673+
"pathname": "/",
3674+
"search": "",
3675+
"hash": ""
3676+
},
3677+
{
3678+
"input": "file:.",
3679+
"base": "http://www.example.com/test",
3680+
"href": "file:///",
3681+
"protocol": "file:",
3682+
"username": "",
3683+
"password": "",
3684+
"host": "",
3685+
"hostname": "",
3686+
"port": "",
3687+
"pathname": "/",
3688+
"search": "",
3689+
"hash": ""
3690+
},
35933691
"# Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/host.html",
35943692
"Basic canonicalization, uppercase should be converted to lowercase",
35953693
{

test/fixtures/wpt/versions.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
"path": "streams"
7373
},
7474
"url": {
75-
"commit": "0f550ab9f5a07ed293926a306e914866164b346b",
75+
"commit": "7f369fef2b6f740a0738510331274bf2cbf7b509",
7676
"path": "url"
7777
},
7878
"user-timing": {

0 commit comments

Comments
 (0)