Skip to content

Commit 10b6b4e

Browse files
Lekotargos
authored andcommitted
test: update url Web Platform Tests
Update url tests to the latest upstream commit. PR-URL: #38435 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Darshan Sen <[email protected]>
1 parent bec959e commit 10b6b4e

File tree

4 files changed

+126
-2
lines changed

4 files changed

+126
-2
lines changed

test/fixtures/wpt/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Last update:
2121
- html/webappapis/timers: https://github.com/web-platform-tests/wpt/tree/5873f2d8f1/html/webappapis/timers
2222
- interfaces: https://github.com/web-platform-tests/wpt/tree/79fa4cf76e/interfaces
2323
- resources: https://github.com/web-platform-tests/wpt/tree/972ca5b669/resources
24-
- url: https://github.com/web-platform-tests/wpt/tree/5eebfdb1f6/url
24+
- url: https://github.com/web-platform-tests/wpt/tree/1439087f27/url
2525

2626
[Web Platform Tests]: https://github.com/web-platform-tests/wpt
2727
[`git node wpt`]: https://github.com/nodejs/node-core-utils/blob/master/docs/git-node.md#git-node-wpt

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

+114
Original file line numberDiff line numberDiff line change
@@ -5945,6 +5945,120 @@
59455945
"search": "",
59465946
"hash": ""
59475947
},
5948+
"# Copy the host from the base URL in the following cases",
5949+
{
5950+
"input": "C|/",
5951+
"base": "file://host/",
5952+
"href": "file://host/C:/",
5953+
"protocol": "file:",
5954+
"username": "",
5955+
"password": "",
5956+
"host": "host",
5957+
"hostname": "host",
5958+
"port": "",
5959+
"pathname": "/C:/",
5960+
"search": "",
5961+
"hash": ""
5962+
},
5963+
{
5964+
"input": "/C:/",
5965+
"base": "file://host/",
5966+
"href": "file://host/C:/",
5967+
"protocol": "file:",
5968+
"username": "",
5969+
"password": "",
5970+
"host": "host",
5971+
"hostname": "host",
5972+
"port": "",
5973+
"pathname": "/C:/",
5974+
"search": "",
5975+
"hash": ""
5976+
},
5977+
{
5978+
"input": "file:C:/",
5979+
"base": "file://host/",
5980+
"href": "file://host/C:/",
5981+
"protocol": "file:",
5982+
"username": "",
5983+
"password": "",
5984+
"host": "host",
5985+
"hostname": "host",
5986+
"port": "",
5987+
"pathname": "/C:/",
5988+
"search": "",
5989+
"hash": ""
5990+
},
5991+
{
5992+
"input": "file:/C:/",
5993+
"base": "file://host/",
5994+
"href": "file://host/C:/",
5995+
"protocol": "file:",
5996+
"username": "",
5997+
"password": "",
5998+
"host": "host",
5999+
"hostname": "host",
6000+
"port": "",
6001+
"pathname": "/C:/",
6002+
"search": "",
6003+
"hash": ""
6004+
},
6005+
"# Copy the empty host from the input in the following cases",
6006+
{
6007+
"input": "//C:/",
6008+
"base": "file://host/",
6009+
"href": "file:///C:/",
6010+
"protocol": "file:",
6011+
"username": "",
6012+
"password": "",
6013+
"host": "",
6014+
"hostname": "",
6015+
"port": "",
6016+
"pathname": "/C:/",
6017+
"search": "",
6018+
"hash": ""
6019+
},
6020+
{
6021+
"input": "file://C:/",
6022+
"base": "file://host/",
6023+
"href": "file:///C:/",
6024+
"protocol": "file:",
6025+
"username": "",
6026+
"password": "",
6027+
"host": "",
6028+
"hostname": "",
6029+
"port": "",
6030+
"pathname": "/C:/",
6031+
"search": "",
6032+
"hash": ""
6033+
},
6034+
{
6035+
"input": "///C:/",
6036+
"base": "file://host/",
6037+
"href": "file:///C:/",
6038+
"protocol": "file:",
6039+
"username": "",
6040+
"password": "",
6041+
"host": "",
6042+
"hostname": "",
6043+
"port": "",
6044+
"pathname": "/C:/",
6045+
"search": "",
6046+
"hash": ""
6047+
},
6048+
{
6049+
"input": "file:///C:/",
6050+
"base": "file://host/",
6051+
"href": "file:///C:/",
6052+
"protocol": "file:",
6053+
"username": "",
6054+
"password": "",
6055+
"host": "",
6056+
"hostname": "",
6057+
"port": "",
6058+
"pathname": "/C:/",
6059+
"search": "",
6060+
"hash": ""
6061+
},
59486062
"# Windows drive letter quirk (no host)",
59496063
{
59506064
"input": "file:/C|/",

test/fixtures/wpt/url/urlsearchparams-stringifier.any.js

+10
Original file line numberDiff line numberDiff line change
@@ -133,3 +133,13 @@ test(() => {
133133
assert_equals(url.toString(), 'http://www.example.com/?a=b%2Cc&x=y');
134134
assert_equals(params.toString(), 'a=b%2Cc&x=y');
135135
}, 'URLSearchParams connected to URL');
136+
137+
test(() => {
138+
const url = new URL('http://www.example.com/');
139+
const params = url.searchParams;
140+
141+
params.append('a\nb', 'c\rd');
142+
params.append('e\n\rf', 'g\r\nh');
143+
144+
assert_equals(params.toString(), "a%0Ab=c%0Dd&e%0A%0Df=g%0D%0Ah");
145+
}, 'URLSearchParams must not do newline normalization');

test/fixtures/wpt/versions.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
"path": "resources"
4545
},
4646
"url": {
47-
"commit": "5eebfdb1f68059549b3efff380dd190bc6078266",
47+
"commit": "1439087f27135b06deb70ffbf43e65ff64ff1ee6",
4848
"path": "url"
4949
}
5050
}

0 commit comments

Comments
 (0)