Skip to content

test: update url Web Platform Tests #38435

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion test/fixtures/wpt/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Last update:
- html/webappapis/timers: https://github.com/web-platform-tests/wpt/tree/5873f2d8f1/html/webappapis/timers
- interfaces: https://github.com/web-platform-tests/wpt/tree/79fa4cf76e/interfaces
- resources: https://github.com/web-platform-tests/wpt/tree/972ca5b669/resources
- url: https://github.com/web-platform-tests/wpt/tree/5eebfdb1f6/url
- url: https://github.com/web-platform-tests/wpt/tree/1439087f27/url

[Web Platform Tests]: https://github.com/web-platform-tests/wpt
[`git node wpt`]: https://github.com/nodejs/node-core-utils/blob/master/docs/git-node.md#git-node-wpt
114 changes: 114 additions & 0 deletions test/fixtures/wpt/url/resources/urltestdata.json
Original file line number Diff line number Diff line change
Expand Up @@ -5945,6 +5945,120 @@
"search": "",
"hash": ""
},
"# Copy the host from the base URL in the following cases",
{
"input": "C|/",
"base": "file://host/",
"href": "file://host/C:/",
"protocol": "file:",
"username": "",
"password": "",
"host": "host",
"hostname": "host",
"port": "",
"pathname": "/C:/",
"search": "",
"hash": ""
},
{
"input": "/C:/",
"base": "file://host/",
"href": "file://host/C:/",
"protocol": "file:",
"username": "",
"password": "",
"host": "host",
"hostname": "host",
"port": "",
"pathname": "/C:/",
"search": "",
"hash": ""
},
{
"input": "file:C:/",
"base": "file://host/",
"href": "file://host/C:/",
"protocol": "file:",
"username": "",
"password": "",
"host": "host",
"hostname": "host",
"port": "",
"pathname": "/C:/",
"search": "",
"hash": ""
},
{
"input": "file:/C:/",
"base": "file://host/",
"href": "file://host/C:/",
"protocol": "file:",
"username": "",
"password": "",
"host": "host",
"hostname": "host",
"port": "",
"pathname": "/C:/",
"search": "",
"hash": ""
},
"# Copy the empty host from the input in the following cases",
{
"input": "//C:/",
"base": "file://host/",
"href": "file:///C:/",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/C:/",
"search": "",
"hash": ""
},
{
"input": "file://C:/",
"base": "file://host/",
"href": "file:///C:/",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/C:/",
"search": "",
"hash": ""
},
{
"input": "///C:/",
"base": "file://host/",
"href": "file:///C:/",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/C:/",
"search": "",
"hash": ""
},
{
"input": "file:///C:/",
"base": "file://host/",
"href": "file:///C:/",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/C:/",
"search": "",
"hash": ""
},
"# Windows drive letter quirk (no host)",
{
"input": "file:/C|/",
Expand Down
10 changes: 10 additions & 0 deletions test/fixtures/wpt/url/urlsearchparams-stringifier.any.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,3 +133,13 @@ test(() => {
assert_equals(url.toString(), 'http://www.example.com/?a=b%2Cc&x=y');
assert_equals(params.toString(), 'a=b%2Cc&x=y');
}, 'URLSearchParams connected to URL');

test(() => {
const url = new URL('http://www.example.com/');
const params = url.searchParams;

params.append('a\nb', 'c\rd');
params.append('e\n\rf', 'g\r\nh');

assert_equals(params.toString(), "a%0Ab=c%0Dd&e%0A%0Df=g%0D%0Ah");
}, 'URLSearchParams must not do newline normalization');
2 changes: 1 addition & 1 deletion test/fixtures/wpt/versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"path": "resources"
},
"url": {
"commit": "5eebfdb1f68059549b3efff380dd190bc6078266",
"commit": "1439087f27135b06deb70ffbf43e65ff64ff1ee6",
"path": "url"
}
}