Skip to content

Commit

Permalink
test: synchronize WPT url test data
Browse files Browse the repository at this point in the history
Refs: web-platform-tests/wpt#4586
Refs: #11887
PR-URL: #12058
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
  • Loading branch information
watilde committed Apr 3, 2017
1 parent f8f46f9 commit 50bfef6
Show file tree
Hide file tree
Showing 2 changed files with 90 additions and 55 deletions.
59 changes: 47 additions & 12 deletions test/fixtures/url-setter-tests.json
Expand Up @@ -28,15 +28,15 @@
"href": "a://example.net",
"new_value": "",
"expected": {
"href": "a://example.net/",
"href": "a://example.net",
"protocol": "a:"
}
},
{
"href": "a://example.net",
"new_value": "b",
"expected": {
"href": "b://example.net/",
"href": "b://example.net",
"protocol": "b:"
}
},
Expand All @@ -45,7 +45,7 @@
"href": "a://example.net",
"new_value": "B",
"expected": {
"href": "b://example.net/",
"href": "b://example.net",
"protocol": "b:"
}
},
Expand All @@ -54,7 +54,7 @@
"href": "a://example.net",
"new_value": "é",
"expected": {
"href": "a://example.net/",
"href": "a://example.net",
"protocol": "a:"
}
},
Expand All @@ -63,7 +63,7 @@
"href": "a://example.net",
"new_value": "0b",
"expected": {
"href": "a://example.net/",
"href": "a://example.net",
"protocol": "a:"
}
},
Expand All @@ -72,15 +72,15 @@
"href": "a://example.net",
"new_value": "+b",
"expected": {
"href": "a://example.net/",
"href": "a://example.net",
"protocol": "a:"
}
},
{
"href": "a://example.net",
"new_value": "bC0+-.",
"expected": {
"href": "bc0+-.://example.net/",
"href": "bc0+-.://example.net",
"protocol": "bc0+-.:"
}
},
Expand All @@ -89,7 +89,7 @@
"href": "a://example.net",
"new_value": "b,c",
"expected": {
"href": "a://example.net/",
"href": "a://example.net",
"protocol": "a:"
}
},
Expand All @@ -98,7 +98,7 @@
"href": "a://example.net",
"new_value": "",
"expected": {
"href": "a://example.net/",
"href": "a://example.net",
"protocol": "a:"
}
},
Expand Down Expand Up @@ -190,23 +190,31 @@
"href": "ssh://me@example.net",
"new_value": "http",
"expected": {
"href": "ssh://me@example.net/",
"href": "ssh://me@example.net",
"protocol": "ssh:"
}
},
{
"href": "ssh://me@example.net",
"new_value": "gopher",
"expected": {
"href": "ssh://me@example.net/",
"href": "ssh://me@example.net",
"protocol": "ssh:"
}
},
{
"href": "ssh://me@example.net",
"new_value": "file",
"expected": {
"href": "ssh://me@example.net/",
"href": "ssh://me@example.net",
"protocol": "ssh:"
}
},
{
"href": "ssh://example.net",
"new_value": "file",
"expected": {
"href": "ssh://example.net",
"protocol": "ssh:"
}
},
Expand Down Expand Up @@ -1072,6 +1080,33 @@
"href": "http://example.net/%3F",
"pathname": "/%3F"
}
},
{
"comment": "# needs to be encoded",
"href": "http://example.net",
"new_value": "#",
"expected": {
"href": "http://example.net/%23",
"pathname": "/%23"
}
},
{
"comment": "? needs to be encoded, non-special scheme",
"href": "sc://example.net",
"new_value": "?",
"expected": {
"href": "sc://example.net/%3F",
"pathname": "/%3F"
}
},
{
"comment": "# needs to be encoded, non-special scheme",
"href": "sc://example.net",
"new_value": "#",
"expected": {
"href": "sc://example.net/%23",
"pathname": "/%23"
}
}
],
"search": [
Expand Down
86 changes: 43 additions & 43 deletions test/fixtures/url-tests.js
Expand Up @@ -571,21 +571,21 @@ module.exports =
"search": "",
"hash": ""
},
// {
// "input": "foo://",
// "base": "http://example.org/foo/bar",
// "href": "foo://",
// "origin": "null",
// "protocol": "foo:",
// "username": "",
// "password": "",
// "host": "",
// "hostname": "",
// "port": "",
// "pathname": "",
// "search": "",
// "hash": ""
// },
{
"input": "foo://",
"base": "http://example.org/foo/bar",
"href": "foo://",
"origin": "null",
"protocol": "foo:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "",
"search": "",
"hash": ""
},
{
"input": "http://a:b@c:29/d",
"base": "http://example.org/foo/bar",
Expand Down Expand Up @@ -5338,34 +5338,34 @@ module.exports =
"search": "",
"hash": ""
},
// {
// "input": "////",
// "base": "sc://x/",
// "href": "sc:////",
// "protocol": "sc:",
// "username": "",
// "password": "",
// "host": "",
// "hostname": "",
// "port": "",
// "pathname": "//",
// "search": "",
// "hash": ""
// },
// {
// "input": "////x/",
// "base": "sc://x/",
// "href": "sc:////x/",
// "protocol": "sc:",
// "username": "",
// "password": "",
// "host": "",
// "hostname": "",
// "port": "",
// "pathname": "//x/",
// "search": "",
// "hash": ""
// },
{
"input": "////",
"base": "sc://x/",
"href": "sc:////",
"protocol": "sc:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "//",
"search": "",
"hash": ""
},
{
"input": "////x/",
"base": "sc://x/",
"href": "sc:////x/",
"protocol": "sc:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "//x/",
"search": "",
"hash": ""
},
{
"input": "tftp://foobar.com/someconfig;mode=netascii",
"base": "about:blank",
Expand Down

0 comments on commit 50bfef6

Please sign in to comment.