diff --git a/url/tests/expected_failures.txt b/url/tests/expected_failures.txt
index 76b764f8c..8d4407c45 100644
--- a/url/tests/expected_failures.txt
+++ b/url/tests/expected_failures.txt
@@ -45,3 +45,29 @@
set pathname to
set pathname to /p>
set pathname to
+
+
+
+
+
+
+@[\\]^_`{|}~>
+@[\\]^_`{|}~>
+//test> against
+//\\//\\//test> against
+//example.org/path> against
+//example.org/../path> against
+//example.org/../../> against
+//example.org/../path/../../> against
+//example.org/../path/../../path> against
+\\//\\/a/../> against
+ 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}>
+ set hash to <>
+ set hash to <>
+ set hash to <>
+ set hash to <>
+ set search to <>
+ set search to <>
+ set search to <>
+ set search to <>
+ set port to <\n\n\t\t>
diff --git a/url/tests/setters_tests.json b/url/tests/setters_tests.json
index 2c6ebee64..5fefffea7 100644
--- a/url/tests/setters_tests.json
+++ b/url/tests/setters_tests.json
@@ -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.",
@@ -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",
@@ -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",
@@ -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": [
@@ -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": [
@@ -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": [
@@ -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"
}
},
{
@@ -2040,6 +2215,14 @@
"href": "http://example.net/%00",
"pathname": "/%00"
}
+ },
+ {
+ "href": "foo://path/to",
+ "new_value": "/..",
+ "expected": {
+ "href": "foo://path/",
+ "pathname": "/"
+ }
}
],
"search": [
@@ -2126,12 +2309,12 @@
}
},
{
- "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": ""
}
},
@@ -2139,17 +2322,17 @@
"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": ""
}
},
@@ -2157,7 +2340,7 @@
"href": "sc:space ?query#fragment",
"new_value": "",
"expected": {
- "href": "sc:space #fragment",
+ "href": "sc:space %20#fragment",
"search": ""
}
},
@@ -2314,12 +2497,12 @@
}
},
{
- "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": ""
}
},
@@ -2327,17 +2510,17 @@
"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": ""
}
},
@@ -2345,7 +2528,7 @@
"href": "sc:space ?query#fragment",
"new_value": "",
"expected": {
- "href": "sc:space ?query",
+ "href": "sc:space %20?query",
"hash": ""
}
},
diff --git a/url/tests/urltestdata.json b/url/tests/urltestdata.json
index 1e61729d1..161072da8 100644
--- a/url/tests/urltestdata.json
+++ b/url/tests/urltestdata.json
@@ -1,5 +1,5 @@
[
- "# Pulled from https://github.com/web-platform-tests/wpt/blob/befe66343e5f21dc464c8c772c6d20695936714f/url/resources/urltestdata.json",
+ "# Pulled from https://github.com/web-platform-tests/wpt/blob/876fe001f2279b96e7c6b9e8970dc92c484835ff/url/resources/urltestdata.json",
{
"input": "http://example\t.\norg",
"base": "http://example.org/foo/bar",
@@ -734,6 +734,36 @@
"search": "",
"hash": ""
},
+ {
+ "input": "http://a:b@c\\",
+ "base": null,
+ "href": "http://a:b@c/",
+ "origin": "http://c",
+ "protocol": "http:",
+ "username": "a",
+ "password": "b",
+ "host": "c",
+ "hostname": "c",
+ "port": "",
+ "pathname": "/",
+ "search": "",
+ "hash": ""
+ },
+ {
+ "input": "ws://a@b\\c",
+ "base": null,
+ "href": "ws://a@b/c",
+ "origin": "ws://b",
+ "protocol": "ws:",
+ "username": "a",
+ "password": "",
+ "host": "b",
+ "hostname": "b",
+ "port": "",
+ "pathname": "/c",
+ "search": "",
+ "hash": ""
+ },
{
"input": "foo:/",
"base": "http://example.org/foo/bar",
@@ -1751,6 +1781,76 @@
"search": "",
"hash": ""
},
+ {
+ "input": "file:///w|m",
+ "base": null,
+ "href": "file:///w|m",
+ "protocol": "file:",
+ "username": "",
+ "password": "",
+ "host": "",
+ "hostname": "",
+ "port": "",
+ "pathname": "/w|m",
+ "search": "",
+ "hash": ""
+ },
+ {
+ "input": "file:///w||m",
+ "base": null,
+ "href": "file:///w||m",
+ "protocol": "file:",
+ "username": "",
+ "password": "",
+ "host": "",
+ "hostname": "",
+ "port": "",
+ "pathname": "/w||m",
+ "search": "",
+ "hash": ""
+ },
+ {
+ "input": "file:///w|/m",
+ "base": null,
+ "href": "file:///w:/m",
+ "protocol": "file:",
+ "username": "",
+ "password": "",
+ "host": "",
+ "hostname": "",
+ "port": "",
+ "pathname": "/w:/m",
+ "search": "",
+ "hash": ""
+ },
+ {
+ "input": "file:C|/m/",
+ "base": null,
+ "href": "file:///C:/m/",
+ "protocol": "file:",
+ "username": "",
+ "password": "",
+ "host": "",
+ "hostname": "",
+ "port": "",
+ "pathname": "/C:/m/",
+ "search": "",
+ "hash": ""
+ },
+ {
+ "input": "file:C||/m/",
+ "base": null,
+ "href": "file:///C||/m/",
+ "protocol": "file:",
+ "username": "",
+ "password": "",
+ "host": "",
+ "hostname": "",
+ "port": "",
+ "pathname": "/C||/m/",
+ "search": "",
+ "hash": ""
+ },
"# Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/script-tests/path.js",
{
"input": "http://example.com/././foo",
@@ -3037,6 +3137,21 @@
"search": "",
"hash": ""
},
+ {
+ "input": "https://example.com/aaa/bbb/%2e%2e?query",
+ "base": null,
+ "href": "https://example.com/aaa/?query",
+ "origin": "https://example.com",
+ "protocol": "https:",
+ "username": "",
+ "password": "",
+ "host": "example.com",
+ "hostname": "example.com",
+ "port": "",
+ "pathname": "/aaa/",
+ "search": "?query",
+ "hash": ""
+ },
"# Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/segments-userinfo-vs-host.html",
{
"input": "http:@www.example.com",
@@ -3560,6 +3675,34 @@
"search": "",
"hash": ""
},
+ {
+ "input": "file:.",
+ "base": null,
+ "href": "file:///",
+ "protocol": "file:",
+ "username": "",
+ "password": "",
+ "host": "",
+ "hostname": "",
+ "port": "",
+ "pathname": "/",
+ "search": "",
+ "hash": ""
+ },
+ {
+ "input": "file:.",
+ "base": "http://www.example.com/test",
+ "href": "file:///",
+ "protocol": "file:",
+ "username": "",
+ "password": "",
+ "host": "",
+ "hostname": "",
+ "port": "",
+ "pathname": "/",
+ "search": "",
+ "hash": ""
+ },
"# Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/host.html",
"Basic canonicalization, uppercase should be converted to lowercase",
{
@@ -3635,6 +3778,126 @@
"search": "",
"hash": ""
},
+ {
+ "input": "non-special:opaque ",
+ "base": null,
+ "href": "non-special:opaque",
+ "origin": "null",
+ "protocol": "non-special:",
+ "username": "",
+ "password": "",
+ "host": "",
+ "hostname": "",
+ "port": "",
+ "pathname": "opaque",
+ "search": "",
+ "hash": ""
+ },
+ {
+ "input": "non-special:opaque ?hi",
+ "base": null,
+ "href": "non-special:opaque %20?hi",
+ "origin": "null",
+ "protocol": "non-special:",
+ "username": "",
+ "password": "",
+ "host": "",
+ "hostname": "",
+ "port": "",
+ "pathname": "opaque %20",
+ "search": "?hi",
+ "hash": ""
+ },
+ {
+ "input": "non-special:opaque #hi",
+ "base": null,
+ "href": "non-special:opaque %20#hi",
+ "origin": "null",
+ "protocol": "non-special:",
+ "username": "",
+ "password": "",
+ "host": "",
+ "hostname": "",
+ "port": "",
+ "pathname": "opaque %20",
+ "search": "",
+ "hash": "#hi"
+ },
+ {
+ "input": "non-special:opaque x?hi",
+ "base": null,
+ "href": "non-special:opaque x?hi",
+ "origin": "null",
+ "protocol": "non-special:",
+ "username": "",
+ "password": "",
+ "host": "",
+ "hostname": "",
+ "port": "",
+ "pathname": "opaque x",
+ "search": "?hi",
+ "hash": ""
+ },
+ {
+ "input": "non-special:opaque x#hi",
+ "base": null,
+ "href": "non-special:opaque x#hi",
+ "origin": "null",
+ "protocol": "non-special:",
+ "username": "",
+ "password": "",
+ "host": "",
+ "hostname": "",
+ "port": "",
+ "pathname": "opaque x",
+ "search": "",
+ "hash": "#hi"
+ },
+ {
+ "input": "non-special:opaque \t\t \t#hi",
+ "base": null,
+ "href": "non-special:opaque %20#hi",
+ "origin": "null",
+ "protocol": "non-special:",
+ "username": "",
+ "password": "",
+ "host": "",
+ "hostname": "",
+ "port": "",
+ "pathname": "opaque %20",
+ "search": "",
+ "hash": "#hi"
+ },
+ {
+ "input": "non-special:opaque \t\t #hi",
+ "base": null,
+ "href": "non-special:opaque %20#hi",
+ "origin": "null",
+ "protocol": "non-special:",
+ "username": "",
+ "password": "",
+ "host": "",
+ "hostname": "",
+ "port": "",
+ "pathname": "opaque %20",
+ "search": "",
+ "hash": "#hi"
+ },
+ {
+ "input": "non-special:opaque\t\t \r #hi",
+ "base": null,
+ "href": "non-special:opaque %20#hi",
+ "origin": "null",
+ "protocol": "non-special:",
+ "username": "",
+ "password": "",
+ "host": "",
+ "hostname": "",
+ "port": "",
+ "pathname": "opaque %20",
+ "search": "",
+ "hash": "#hi"
+ },
"Ideographic full stop (full-width period for Chinese, etc.) should be treated as a dot. U+3002 is mapped to U+002E (dot)",
{
"input": "http://www.foo。bar.com",
@@ -7836,7 +8099,6 @@
"input": "blob:file://host/path",
"base": null,
"href": "blob:file://host/path",
- "origin": "null",
"protocol": "blob:",
"username": "",
"password": "",
@@ -8365,6 +8627,21 @@
"search": "",
"username": ""
},
+ {
+ "input": "non-special:cannot-be-a-base-url-!\"$%&'()*+,-.;<=>@[\\]^_`{|}~@/",
+ "base": null,
+ "hash": "",
+ "host": "",
+ "hostname": "",
+ "href": "non-special:cannot-be-a-base-url-!\"$%&'()*+,-.;<=>@[\\]^_`{|}~@/",
+ "origin": "null",
+ "password": "",
+ "pathname": "cannot-be-a-base-url-!\"$%&'()*+,-.;<=>@[\\]^_`{|}~@/",
+ "port": "",
+ "protocol": "non-special:",
+ "search": "",
+ "username": ""
+ },
{
"input": "https://www.example.com/path{\u007Fpath.html?query'\u007F=query#fragment<\u007Ffragment",
"base": null,
@@ -8492,10 +8769,10 @@
"hash": "",
"host": "host",
"hostname": "host",
- "href": "foo://host/%20!%22$%&'()*+,-./:;%3C=%3E@[\\]^_%60%7B|%7D~",
+ "href": "foo://host/%20!%22$%&'()*+,-./:;%3C=%3E@[\\]%5E_%60%7B|%7D~",
"origin": "null",
"password": "",
- "pathname": "/%20!%22$%&'()*+,-./:;%3C=%3E@[\\]^_%60%7B|%7D~",
+ "pathname": "/%20!%22$%&'()*+,-./:;%3C=%3E@[\\]%5E_%60%7B|%7D~",
"port":"",
"protocol": "foo:",
"search": "",
@@ -8507,10 +8784,10 @@
"hash": "",
"host": "host",
"hostname": "host",
- "href": "wss://host/%20!%22$%&'()*+,-./:;%3C=%3E@[/]^_%60%7B|%7D~",
+ "href": "wss://host/%20!%22$%&'()*+,-./:;%3C=%3E@[/]%5E_%60%7B|%7D~",
"origin": "wss://host",
"password": "",
- "pathname": "/%20!%22$%&'()*+,-./:;%3C=%3E@[/]^_%60%7B|%7D~",
+ "pathname": "/%20!%22$%&'()*+,-./:;%3C=%3E@[/]%5E_%60%7B|%7D~",
"port":"",
"protocol": "wss:",
"search": "",
@@ -9515,5 +9792,451 @@
"pathname": "",
"search": "",
"hash": ""
+ },
+ {
+ "input": "android://x:0/a",
+ "base": null,
+ "href": "android://x:0/a",
+ "origin": "null",
+ "protocol": "android:",
+ "username": "",
+ "password": "",
+ "host": "x:0",
+ "hostname": "x",
+ "port": "0",
+ "pathname": "/a",
+ "search": "",
+ "hash": ""
+ },
+ {
+ "input": "drivefs://x:0/a",
+ "base": null,
+ "href": "drivefs://x:0/a",
+ "origin": "null",
+ "protocol": "drivefs:",
+ "username": "",
+ "password": "",
+ "host": "x:0",
+ "hostname": "x",
+ "port": "0",
+ "pathname": "/a",
+ "search": "",
+ "hash": ""
+ },
+ {
+ "input": "chromeos-steam://x:0/a",
+ "base": null,
+ "href": "chromeos-steam://x:0/a",
+ "origin": "null",
+ "protocol": "chromeos-steam:",
+ "username": "",
+ "password": "",
+ "host": "x:0",
+ "hostname": "x",
+ "port": "0",
+ "pathname": "/a",
+ "search": "",
+ "hash": ""
+ },
+ {
+ "input": "steam://x:0/a",
+ "base": null,
+ "href": "steam://x:0/a",
+ "origin": "null",
+ "protocol": "steam:",
+ "username": "",
+ "password": "",
+ "host": "x:0",
+ "hostname": "x",
+ "port": "0",
+ "pathname": "/a",
+ "search": "",
+ "hash": ""
+ },
+ {
+ "input": "materialized-view://x:0/a",
+ "base": null,
+ "href": "materialized-view://x:0/a",
+ "origin": "null",
+ "protocol": "materialized-view:",
+ "username": "",
+ "password": "",
+ "host": "x:0",
+ "hostname": "x",
+ "port": "0",
+ "pathname": "/a",
+ "search": "",
+ "hash": ""
+ },
+ {
+ "input": "android-app://x:0",
+ "base": null,
+ "href": "android-app://x:0",
+ "origin": "null",
+ "protocol": "android-app:",
+ "username": "",
+ "password": "",
+ "host": "x:0",
+ "hostname": "x",
+ "port": "0",
+ "pathname": "",
+ "search": "",
+ "hash": ""
+ },
+ {
+ "input": "chrome-distiller://x:0",
+ "base": null,
+ "href": "chrome-distiller://x:0",
+ "origin": "null",
+ "protocol": "chrome-distiller:",
+ "username": "",
+ "password": "",
+ "host": "x:0",
+ "hostname": "x",
+ "port": "0",
+ "pathname": "",
+ "search": "",
+ "hash": ""
+ },
+ {
+ "input": "chrome-extension://x:0",
+ "base": null,
+ "href": "chrome-extension://x:0",
+ "origin": "null",
+ "protocol": "chrome-extension:",
+ "username": "",
+ "password": "",
+ "host": "x:0",
+ "hostname": "x",
+ "port": "0",
+ "pathname": "",
+ "search": "",
+ "hash": ""
+ },
+ {
+ "input": "chrome-native://x:0",
+ "base": null,
+ "href": "chrome-native://x:0",
+ "origin": "null",
+ "protocol": "chrome-native:",
+ "username": "",
+ "password": "",
+ "host": "x:0",
+ "hostname": "x",
+ "port": "0",
+ "pathname": "",
+ "search": "",
+ "hash": ""
+ },
+ {
+ "input": "chrome-resource://x:0",
+ "base": null,
+ "href": "chrome-resource://x:0",
+ "origin": "null",
+ "protocol": "chrome-resource:",
+ "username": "",
+ "password": "",
+ "host": "x:0",
+ "hostname": "x",
+ "port": "0",
+ "pathname": "",
+ "search": "",
+ "hash": ""
+ },
+ {
+ "input": "chrome-search://x:0",
+ "base": null,
+ "href": "chrome-search://x:0",
+ "origin": "null",
+ "protocol": "chrome-search:",
+ "username": "",
+ "password": "",
+ "host": "x:0",
+ "hostname": "x",
+ "port": "0",
+ "pathname": "",
+ "search": "",
+ "hash": ""
+ },
+ {
+ "input": "fuchsia-dir://x:0",
+ "base": null,
+ "href": "fuchsia-dir://x:0",
+ "origin": "null",
+ "protocol": "fuchsia-dir:",
+ "username": "",
+ "password": "",
+ "host": "x:0",
+ "hostname": "x",
+ "port": "0",
+ "pathname": "",
+ "search": "",
+ "hash": ""
+ },
+ {
+ "input": "isolated-app://x:0",
+ "base": null,
+ "href": "isolated-app://x:0",
+ "origin": "null",
+ "protocol": "isolated-app:",
+ "username": "",
+ "password": "",
+ "host": "x:0",
+ "hostname": "x",
+ "port": "0",
+ "pathname": "",
+ "search": "",
+ "hash": ""
+ },
+ "Scheme relative path starting with multiple slashes",
+ {
+ "input": "///test",
+ "base": "http://example.org/",
+ "href": "http://test/",
+ "protocol": "http:",
+ "username": "",
+ "password": "",
+ "host": "test",
+ "hostname": "test",
+ "port": "",
+ "pathname": "/",
+ "search": "",
+ "hash": ""
+ },
+ {
+ "input": "///\\//\\//test",
+ "base": "http://example.org/",
+ "href": "http://test/",
+ "protocol": "http:",
+ "username": "",
+ "password": "",
+ "host": "test",
+ "hostname": "test",
+ "port": "",
+ "pathname": "/",
+ "search": "",
+ "hash": ""
+ },
+ {
+ "input": "///example.org/path",
+ "base": "http://example.org/",
+ "href": "http://example.org/path",
+ "protocol": "http:",
+ "username": "",
+ "password": "",
+ "host": "example.org",
+ "hostname": "example.org",
+ "port": "",
+ "pathname": "/path",
+ "search": "",
+ "hash": ""
+ },
+ {
+ "input": "///example.org/../path",
+ "base": "http://example.org/",
+ "href": "http://example.org/path",
+ "protocol": "http:",
+ "username": "",
+ "password": "",
+ "host": "example.org",
+ "hostname": "example.org",
+ "port": "",
+ "pathname": "/path",
+ "search": "",
+ "hash": ""
+ },
+ {
+ "input": "///example.org/../../",
+ "base": "http://example.org/",
+ "href": "http://example.org/",
+ "protocol": "http:",
+ "username": "",
+ "password": "",
+ "host": "example.org",
+ "hostname": "example.org",
+ "port": "",
+ "pathname": "/",
+ "search": "",
+ "hash": ""
+ },
+ {
+ "input": "///example.org/../path/../../",
+ "base": "http://example.org/",
+ "href": "http://example.org/",
+ "protocol": "http:",
+ "username": "",
+ "password": "",
+ "host": "example.org",
+ "hostname": "example.org",
+ "port": "",
+ "pathname": "/",
+ "search": "",
+ "hash": ""
+ },
+ {
+ "input": "///example.org/../path/../../path",
+ "base": "http://example.org/",
+ "href": "http://example.org/path",
+ "protocol": "http:",
+ "username": "",
+ "password": "",
+ "host": "example.org",
+ "hostname": "example.org",
+ "port": "",
+ "pathname": "/path",
+ "search": "",
+ "hash": ""
+ },
+ {
+ "input": "/\\/\\//example.org/../path",
+ "base": "http://example.org/",
+ "href": "http://example.org/path",
+ "protocol": "http:",
+ "username": "",
+ "password": "",
+ "host": "example.org",
+ "hostname": "example.org",
+ "port": "",
+ "pathname": "/path",
+ "search": "",
+ "hash": ""
+ },
+ {
+ "input": "///abcdef/../",
+ "base": "file:///",
+ "href": "file:///",
+ "protocol": "file:",
+ "username": "",
+ "password": "",
+ "host": "",
+ "hostname": "",
+ "port": "",
+ "pathname": "/",
+ "search": "",
+ "hash": ""
+ },
+ {
+ "input": "/\\//\\/a/../",
+ "base": "file:///",
+ "href": "file://////",
+ "protocol": "file:",
+ "username": "",
+ "password": "",
+ "host": "",
+ "hostname": "",
+ "port": "",
+ "pathname": "////",
+ "search": "",
+ "hash": ""
+ },
+ {
+ "input": "//a/../",
+ "base": "file:///",
+ "href": "file://a/",
+ "protocol": "file:",
+ "username": "",
+ "password": "",
+ "host": "a",
+ "hostname": "a",
+ "port": "",
+ "pathname": "/",
+ "search": "",
+ "hash": ""
+ },
+ "# Non-special URL and backslashes",
+ {
+ "input": "non-special:\\\\opaque",
+ "base": null,
+ "href": "non-special:\\\\opaque",
+ "origin": "null",
+ "protocol": "non-special:",
+ "username": "",
+ "password": "",
+ "host": "",
+ "hostname": "",
+ "port": "",
+ "pathname": "\\\\opaque",
+ "search": "",
+ "hash": ""
+ },
+ {
+ "input": "non-special:\\\\opaque/path",
+ "base": null,
+ "href": "non-special:\\\\opaque/path",
+ "origin": "null",
+ "protocol": "non-special:",
+ "username": "",
+ "password": "",
+ "host": "",
+ "hostname": "",
+ "port": "",
+ "pathname": "\\\\opaque/path",
+ "search": "",
+ "hash": ""
+ },
+ {
+ "input": "non-special:\\\\opaque\\path",
+ "base": null,
+ "href": "non-special:\\\\opaque\\path",
+ "origin": "null",
+ "protocol": "non-special:",
+ "username": "",
+ "password": "",
+ "host": "",
+ "hostname": "",
+ "port": "",
+ "pathname": "\\\\opaque\\path",
+ "search": "",
+ "hash": ""
+ },
+ {
+ "input": "non-special:\\/opaque",
+ "base": null,
+ "href": "non-special:\\/opaque",
+ "origin": "null",
+ "protocol": "non-special:",
+ "username": "",
+ "password": "",
+ "host": "",
+ "hostname": "",
+ "port": "",
+ "pathname": "\\/opaque",
+ "search": "",
+ "hash": ""
+ },
+ {
+ "input": "non-special:/\\path",
+ "base": null,
+ "href": "non-special:/\\path",
+ "origin": "null",
+ "protocol": "non-special:",
+ "username": "",
+ "password": "",
+ "host": "",
+ "hostname": "",
+ "port": "",
+ "pathname": "/\\path",
+ "search": "",
+ "hash": ""
+ },
+ {
+ "input": "non-special://host\\a",
+ "base": null,
+ "failure": true
+ },
+ {
+ "input": "non-special://host/a\\b",
+ "base": null,
+ "href": "non-special://host/a\\b",
+ "origin": "null",
+ "protocol": "non-special:",
+ "username": "",
+ "password": "",
+ "host": "host",
+ "hostname": "host",
+ "port": "",
+ "pathname": "/a\\b",
+ "search": "",
+ "hash": ""
}
]
diff --git a/url_debug_tests/Cargo.toml b/url_debug_tests/Cargo.toml
index ca9b16b81..d54f3dc72 100644
--- a/url_debug_tests/Cargo.toml
+++ b/url_debug_tests/Cargo.toml
@@ -4,6 +4,7 @@ name = "url_debug_tests"
version = "0.0.0"
description = "Tests for debugger visualizers defined for the url crate such as url.natvis"
publish = false
+edition = "2018"
rust-version = "1.60"
[dev-dependencies]