Skip to content

Commit

Permalink
Bug 1660084 [wpt PR 25113] - Test non-special URLs are idempotent, a=…
Browse files Browse the repository at this point in the history
…testonly

Automatic update from web-platform-tests
Test non-special URLs are idempotent

See whatwg/url#415 and
whatwg/url#505 for context.

--

wpt-commits: 551c9d604fb8b97d3f8c65793bb047d15baddbc2
wpt-pr: 25113
  • Loading branch information
rmisev authored and moz-wptsync-bot committed Aug 27, 2020
1 parent 1a25dc1 commit 07dd34a
Show file tree
Hide file tree
Showing 2 changed files with 239 additions and 0 deletions.
55 changes: 55 additions & 0 deletions testing/web-platform/tests/url/resources/setters_tests.json
Expand Up @@ -1324,6 +1324,27 @@
"hostname": "test",
"port": "12"
}
},
{
"comment": "Drop /. from path",
"href": "non-spec:/.//p",
"new_value": "h",
"expected": {
"href": "non-spec://h//p",
"host": "h",
"hostname": "h",
"pathname": "//p"
}
},
{
"href": "non-spec:/.//p",
"new_value": "",
"expected": {
"href": "non-spec:////p",
"host": "",
"hostname": "",
"pathname": "//p"
}
}
],
"port": [
Expand Down Expand Up @@ -1672,6 +1693,40 @@
"href": "file:///",
"pathname": "/"
}
},
{
"comment": "Serialize /. in path",
"href": "non-spec:/",
"new_value": "/.//p",
"expected": {
"href": "non-spec:/.//p",
"pathname": "//p"
}
},
{
"href": "non-spec:/",
"new_value": "/..//p",
"expected": {
"href": "non-spec:/.//p",
"pathname": "//p"
}
},
{
"href": "non-spec:/",
"new_value": "//p",
"expected": {
"href": "non-spec:/.//p",
"pathname": "//p"
}
},
{
"comment": "Drop /. from path",
"href": "non-spec:/.//",
"new_value": "p",
"expected": {
"href": "non-spec:/p",
"pathname": "/p"
}
}
],
"search": [
Expand Down
184 changes: 184 additions & 0 deletions testing/web-platform/tests/url/resources/urltestdata.json
Expand Up @@ -6445,6 +6445,190 @@
"search": "",
"hash": ""
},
"Serialize /. in path",
{
"input": "non-spec:/.//",
"base": "about:blank",
"href": "non-spec:/.//",
"protocol": "non-spec:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "//",
"search": "",
"hash": ""
},
{
"input": "non-spec:/..//",
"base": "about:blank",
"href": "non-spec:/.//",
"protocol": "non-spec:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "//",
"search": "",
"hash": ""
},
{
"input": "non-spec:/a/..//",
"base": "about:blank",
"href": "non-spec:/.//",
"protocol": "non-spec:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "//",
"search": "",
"hash": ""
},
{
"input": "non-spec:/.//path",
"base": "about:blank",
"href": "non-spec:/.//path",
"protocol": "non-spec:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "//path",
"search": "",
"hash": ""
},
{
"input": "non-spec:/..//path",
"base": "about:blank",
"href": "non-spec:/.//path",
"protocol": "non-spec:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "//path",
"search": "",
"hash": ""
},
{
"input": "non-spec:/a/..//path",
"base": "about:blank",
"href": "non-spec:/.//path",
"protocol": "non-spec:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "//path",
"search": "",
"hash": ""
},
{
"input": "/.//path",
"base": "non-spec:/p",
"href": "non-spec:/.//path",
"protocol": "non-spec:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "//path",
"search": "",
"hash": ""
},
{
"input": "/..//path",
"base": "non-spec:/p",
"href": "non-spec:/.//path",
"protocol": "non-spec:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "//path",
"search": "",
"hash": ""
},
{
"input": "..//path",
"base": "non-spec:/p",
"href": "non-spec:/.//path",
"protocol": "non-spec:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "//path",
"search": "",
"hash": ""
},
{
"input": "a/..//path",
"base": "non-spec:/p",
"href": "non-spec:/.//path",
"protocol": "non-spec:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "//path",
"search": "",
"hash": ""
},
{
"input": "",
"base": "non-spec:/..//p",
"href": "non-spec:/.//p",
"protocol": "non-spec:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "//p",
"search": "",
"hash": ""
},
{
"input": "path",
"base": "non-spec:/..//p",
"href": "non-spec:/.//path",
"protocol": "non-spec:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "//path",
"search": "",
"hash": ""
},
"Do not serialize /. in path",
{
"input": "../path",
"base": "non-spec:/.//p",
"href": "non-spec:/path",
"protocol": "non-spec:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/path",
"search": "",
"hash": ""
},
"# percent encoded hosts in non-special-URLs",
{
"input": "non-special://%E2%80%A0/",
Expand Down

0 comments on commit 07dd34a

Please sign in to comment.