Skip to content

Commit 1c1bd7c

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 3505782 commit 1c1bd7c

File tree

6 files changed

+159
-3
lines changed

6 files changed

+159
-3
lines changed

test/fixtures/wpt/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Last update:
2727
- resource-timing: https://github.com/web-platform-tests/wpt/tree/22d38586d0/resource-timing
2828
- resources: https://github.com/web-platform-tests/wpt/tree/1e140d63ec/resources
2929
- streams: https://github.com/web-platform-tests/wpt/tree/9b03282a99/streams
30-
- url: https://github.com/web-platform-tests/wpt/tree/0f550ab9f5/url
30+
- url: https://github.com/web-platform-tests/wpt/tree/7f369fef2b/url
3131
- user-timing: https://github.com/web-platform-tests/wpt/tree/5ae85bf826/user-timing
3232
- wasm/jsapi: https://github.com/web-platform-tests/wpt/tree/cde25e7e3c/wasm/jsapi
3333
- 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
@@ -1751,6 +1751,76 @@
17511751
"search": "",
17521752
"hash": ""
17531753
},
1754+
{
1755+
"input": "file:///w|m",
1756+
"base": null,
1757+
"href": "file:///w|m",
1758+
"protocol": "file:",
1759+
"username": "",
1760+
"password": "",
1761+
"host": "",
1762+
"hostname": "",
1763+
"port": "",
1764+
"pathname": "/w|m",
1765+
"search": "",
1766+
"hash": ""
1767+
},
1768+
{
1769+
"input": "file:///w||m",
1770+
"base": null,
1771+
"href": "file:///w||m",
1772+
"protocol": "file:",
1773+
"username": "",
1774+
"password": "",
1775+
"host": "",
1776+
"hostname": "",
1777+
"port": "",
1778+
"pathname": "/w||m",
1779+
"search": "",
1780+
"hash": ""
1781+
},
1782+
{
1783+
"input": "file:///w|/m",
1784+
"base": null,
1785+
"href": "file:///w:/m",
1786+
"protocol": "file:",
1787+
"username": "",
1788+
"password": "",
1789+
"host": "",
1790+
"hostname": "",
1791+
"port": "",
1792+
"pathname": "/w:/m",
1793+
"search": "",
1794+
"hash": ""
1795+
},
1796+
{
1797+
"input": "file:C|/m/",
1798+
"base": null,
1799+
"href": "file:///C:/m/",
1800+
"protocol": "file:",
1801+
"username": "",
1802+
"password": "",
1803+
"host": "",
1804+
"hostname": "",
1805+
"port": "",
1806+
"pathname": "/C:/m/",
1807+
"search": "",
1808+
"hash": ""
1809+
},
1810+
{
1811+
"input": "file:C||/m/",
1812+
"base": null,
1813+
"href": "file:///C||/m/",
1814+
"protocol": "file:",
1815+
"username": "",
1816+
"password": "",
1817+
"host": "",
1818+
"hostname": "",
1819+
"port": "",
1820+
"pathname": "/C||/m/",
1821+
"search": "",
1822+
"hash": ""
1823+
},
17541824
"# Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/script-tests/path.js",
17551825
{
17561826
"input": "http://example.com/././foo",
@@ -3560,6 +3630,34 @@
35603630
"search": "",
35613631
"hash": ""
35623632
},
3633+
{
3634+
"input": "file:.",
3635+
"base": null,
3636+
"href": "file:///",
3637+
"protocol": "file:",
3638+
"username": "",
3639+
"password": "",
3640+
"host": "",
3641+
"hostname": "",
3642+
"port": "",
3643+
"pathname": "/",
3644+
"search": "",
3645+
"hash": ""
3646+
},
3647+
{
3648+
"input": "file:.",
3649+
"base": "http://www.example.com/test",
3650+
"href": "file:///",
3651+
"protocol": "file:",
3652+
"username": "",
3653+
"password": "",
3654+
"host": "",
3655+
"hostname": "",
3656+
"port": "",
3657+
"pathname": "/",
3658+
"search": "",
3659+
"hash": ""
3660+
},
35633661
"# Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/host.html",
35643662
"Basic canonicalization, uppercase should be converted to lowercase",
35653663
{

test/fixtures/wpt/versions.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
"path": "streams"
6969
},
7070
"url": {
71-
"commit": "c2d7e70b52cbd9a5b938aa32f37078d7a71e0b21",
71+
"commit": "7f369fef2b6f740a0738510331274bf2cbf7b509",
7272
"path": "url"
7373
},
7474
"user-timing": {
@@ -95,4 +95,4 @@
9595
"commit": "e97fac4791931fb7455ba3fad759d362c7108b09",
9696
"path": "webmessaging/broadcastchannel"
9797
}
98-
}
98+
}

0 commit comments

Comments
 (0)