Skip to content
Merged
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
26 changes: 26 additions & 0 deletions url/tests/expected_failures.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,29 @@
<non-spec:/> set pathname to </..//p>
<non-spec:/> set pathname to <//p>
<non-spec:/.//> set pathname to <p>
<file:///w|/m>
<non-special:opaque ?hi>
<non-special:opaque #hi>
<non-special:opaque \t\t \t#hi>
<non-special:opaque \t\t #hi>
<non-special:opaque\t\t \r #hi>
<foo://host/ !\"$%&\'()*+,-./:;<=>@[\\]^_`{|}~>
<wss://host/ !\"$%&\'()*+,-./:;<=>@[\\]^_`{|}~>
<///test> against <http://example.org/>
<///\\//\\//test> against <http://example.org/>
<///example.org/path> against <http://example.org/>
<///example.org/../path> against <http://example.org/>
<///example.org/../../> against <http://example.org/>
<///example.org/../path/../../> against <http://example.org/>
<///example.org/../path/../../path> against <http://example.org/>
</\\//\\/a/../> against <file:///>
<a:/> set pathname to <\u{0}\u{1}\t\n\r\u{1f} !\"#$%&\'()*+,-./09:;<=>?@AZ[\\]^_`az{|}~\u{7f}\u{80}\u{81}\u{c9}\u{e9}>
<data:space #fragment> set hash to <>
<sc:space #fragment> set hash to <>
<data:space ?query#fragment> set hash to <>
<sc:space ?query#fragment> set hash to <>
<data:space ?query> set search to <>
<sc:space ?query> set search to <>
<data:space ?query#fragment> set search to <>
<sc:space ?query#fragment> set search to <>
<https://domain.com:3000> set port to <\n\n\t\t>
221 changes: 202 additions & 19 deletions url/tests/setters_tests.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"comment": [
"# Pulled from https://github.com/web-platform-tests/wpt/blob/befe66343e5f21dc464c8c772c6d20695936714f/url/resources/setters_tests.json",
"# Pulled from https://github.com/web-platform-tests/wpt/blob/876fe001f2279b96e7c6b9e8970dc92c484835ff/url/resources/setters_tests.json",
"## Tests for setters of https://url.spec.whatwg.org/#urlutils-members",
"",
"This file contains a JSON object.",
Expand Down Expand Up @@ -826,6 +826,17 @@
"port": ""
}
},
{
"comment": "Stuff after a ? delimiter is ignored, trailing 'port'",
"href": "http://example.net/path",
"new_value": "example.com?stuff:8080",
"expected": {
"href": "http://example.com/path",
"host": "example.com",
"hostname": "example.com",
"port": ""
}
},
{
"comment": "Stuff after a ? delimiter is ignored",
"href": "http://example.net/path",
Expand Down Expand Up @@ -925,6 +936,39 @@
"port": "8080"
}
},
{
"comment": "Anything other than ASCII digit stops the port parser in a setter but is not an error",
"href": "http://example.net:8080",
"new_value": "example.com:invalid",
"expected": {
"href": "http://example.com:8080/",
"host": "example.com:8080",
"hostname": "example.com",
"port": "8080"
}
},
{
"comment": "Anything other than ASCII digit stops the port parser in a setter but is not an error",
"href": "http://example.net:8080/test",
"new_value": "[::1]:invalid",
"expected": {
"href": "http://[::1]:8080/test",
"host": "[::1]:8080",
"hostname": "[::1]",
"port": "8080"
}
},
{
"comment": "IPv6 without port",
"href": "http://example.net:8080/test",
"new_value": "[::1]",
"expected": {
"href": "http://[::1]:8080/test",
"host": "[::1]:8080",
"hostname": "[::1]",
"port": "8080"
}
},
{
"comment": "Port numbers are 16 bit integers",
"href": "http://example.net/path",
Expand Down Expand Up @@ -1098,6 +1142,69 @@
"host": "example.com",
"hostname": "example.com"
}
},
{
"href": "https://test.invalid/",
"new_value": "*",
"expected": {
"href": "https://*/",
"host": "*",
"hostname": "*"
}
},
{
"href": "https://test.invalid/",
"new_value": "x@x",
"expected": {
"href": "https://test.invalid/",
"host": "test.invalid",
"hostname": "test.invalid"
}
},
{
"href": "https://test.invalid/",
"new_value": "foo\t\r\nbar",
"expected": {
"href": "https://foobar/",
"host": "foobar",
"hostname": "foobar"
}
},
{
"href": "https://test.invalid/",
"new_value": "><",
"expected": {
"href": "https://test.invalid/",
"host": "test.invalid",
"hostname": "test.invalid"
}
},
{
"href": "https://test.invalid/",
"new_value": "test/@aaa",
"expected": {
"href": "https://test/",
"host": "test",
"hostname": "test"
}
},
{
"href": "https://test.invalid/",
"new_value": "test/:aaa",
"expected": {
"href": "https://test/",
"host": "test",
"hostname": "test"
}
},
{
"href": "foo://path/to",
"new_value": ":80",
"expected": {
"href": "foo://path/to",
"host": "path",
"port": ""
}
}
],
"hostname": [
Expand Down Expand Up @@ -1509,6 +1616,60 @@
"host": "example.com",
"hostname": "example.com"
}
},
{
"href": "https://test.invalid/",
"new_value": "*",
"expected": {
"href": "https://*/",
"host": "*",
"hostname": "*"
}
},
{
"href": "https://test.invalid/",
"new_value": "x@x",
"expected": {
"href": "https://test.invalid/",
"host": "test.invalid",
"hostname": "test.invalid"
}
},
{
"href": "https://test.invalid/",
"new_value": "foo\t\r\nbar",
"expected": {
"href": "https://foobar/",
"host": "foobar",
"hostname": "foobar"
}
},
{
"href": "https://test.invalid/",
"new_value": "><",
"expected": {
"href": "https://test.invalid/",
"host": "test.invalid",
"hostname": "test.invalid"
}
},
{
"href": "https://test.invalid/",
"new_value": "test/@aaa",
"expected": {
"href": "https://test/",
"host": "test",
"hostname": "test"
}
},
{
"href": "https://test.invalid/",
"new_value": "test/:aaa",
"expected": {
"href": "https://test/",
"host": "test",
"hostname": "test"
}
}
],
"port": [
Expand Down Expand Up @@ -1758,6 +1919,20 @@
"expected": {
"port": "4"
}
},
{
"href": "https://domain.com:3000",
"new_value": "\n\t80\n\t80\n\t",
"expected": {
"port": "8080"
}
},
{
"href": "https://domain.com:3000",
"new_value": "\n\n\t\t",
"expected": {
"port": "3000"
}
}
],
"pathname": [
Expand Down Expand Up @@ -1878,8 +2053,8 @@
"href": "a:/",
"new_value": "\u0000\u0001\t\n\r\u001f !\"#$%&'()*+,-./09:;<=>?@AZ[\\]^_`az{|}~\u007f\u0080\u0081Éé",
"expected": {
"href": "a:/%00%01%1F%20!%22%23$%&'()*+,-./09:;%3C=%3E%3F@AZ[\\]^_%60az%7B|%7D~%7F%C2%80%C2%81%C3%89%C3%A9",
"pathname": "/%00%01%1F%20!%22%23$%&'()*+,-./09:;%3C=%3E%3F@AZ[\\]^_%60az%7B|%7D~%7F%C2%80%C2%81%C3%89%C3%A9"
"href": "a:/%00%01%1F%20!%22%23$%&'()*+,-./09:;%3C=%3E%3F@AZ[\\]%5E_%60az%7B|%7D~%7F%C2%80%C2%81%C3%89%C3%A9",
"pathname": "/%00%01%1F%20!%22%23$%&'()*+,-./09:;%3C=%3E%3F@AZ[\\]%5E_%60az%7B|%7D~%7F%C2%80%C2%81%C3%89%C3%A9"
}
},
{
Expand Down Expand Up @@ -2040,6 +2215,14 @@
"href": "http://example.net/%00",
"pathname": "/%00"
}
},
{
"href": "foo://path/to",
"new_value": "/..",
"expected": {
"href": "foo://path/",
"pathname": "/"
}
}
],
"search": [
Expand Down Expand Up @@ -2126,38 +2309,38 @@
}
},
{
"comment": "Drop trailing spaces from trailing opaque paths",
"comment": "Trailing spaces and opaque paths",
"href": "data:space ?query",
"new_value": "",
"expected": {
"href": "data:space",
"pathname": "space",
"href": "data:space%20",
"pathname": "space%20",
"search": ""
}
},
{
"href": "sc:space ?query",
"new_value": "",
"expected": {
"href": "sc:space",
"pathname": "space",
"href": "sc:space%20",
"pathname": "space%20",
"search": ""
}
},
{
"comment": "Do not drop trailing spaces from non-trailing opaque paths",
"comment": "Trailing spaces and opaque paths",
"href": "data:space ?query#fragment",
"new_value": "",
"expected": {
"href": "data:space #fragment",
"href": "data:space %20#fragment",
"search": ""
}
},
{
"href": "sc:space ?query#fragment",
"new_value": "",
"expected": {
"href": "sc:space #fragment",
"href": "sc:space %20#fragment",
"search": ""
}
},
Expand Down Expand Up @@ -2314,38 +2497,38 @@
}
},
{
"comment": "Drop trailing spaces from trailing opaque paths",
"comment": "Trailing spaces and opaque paths",
"href": "data:space #fragment",
"new_value": "",
"expected": {
"href": "data:space",
"pathname": "space",
"href": "data:space %20",
"pathname": "space %20",
"hash": ""
}
},
{
"href": "sc:space #fragment",
"new_value": "",
"expected": {
"href": "sc:space",
"pathname": "space",
"href": "sc:space %20",
"pathname": "space %20",
"hash": ""
}
},
{
"comment": "Do not drop trailing spaces from non-trailing opaque paths",
"comment": "Trailing spaces and opaque paths",
"href": "data:space ?query#fragment",
"new_value": "",
"expected": {
"href": "data:space ?query",
"href": "data:space %20?query",
"hash": ""
}
},
{
"href": "sc:space ?query#fragment",
"new_value": "",
"expected": {
"href": "sc:space ?query",
"href": "sc:space %20?query",
"hash": ""
}
},
Expand Down
Loading
Loading