Skip to content

Commit

Permalink
Bug 1715195 [wpt PR 29271] - URL: Add some possible bugs seen in impl…
Browse files Browse the repository at this point in the history
…ementation, a=testonly

Automatic update from web-platform-tests
URL: Add some possible bugs seen in implementation

Collected from:

- nodejs/node#36559
- https://bugs.webkit.org/show_bug.cgi?id=226136
- https://crbug.com/1212318

--

wpt-commits: 2cfdb63014d1158fd15eb1f798f6b1610c275271
wpt-pr: 29271
  • Loading branch information
TimothyGu authored and moz-wptsync-bot committed Jun 15, 2021
1 parent 1249d8f commit df93b47
Show file tree
Hide file tree
Showing 2 changed files with 88 additions and 0 deletions.
58 changes: 58 additions & 0 deletions testing/web-platform/tests/url/resources/setters_tests.json
Original file line number Diff line number Diff line change
Expand Up @@ -990,6 +990,26 @@
"hostname": "test",
"port": "12"
}
},
{
"comment": "Leading / is not stripped",
"href": "http://example.com/",
"new_value": "///bad.com",
"expected": {
"href": "http://example.com/",
"host": "example.com",
"hostname": "example.com"
}
},
{
"comment": "Leading / is not stripped",
"href": "sc://example.com/",
"new_value": "///bad.com",
"expected": {
"href": "sc:///",
"host": "",
"hostname": ""
}
}
],
"hostname": [
Expand Down Expand Up @@ -1345,6 +1365,26 @@
"hostname": "",
"pathname": "//p"
}
},
{
"comment": "Leading / is not stripped",
"href": "http://example.com/",
"new_value": "///bad.com",
"expected": {
"href": "http://example.com/",
"host": "example.com",
"hostname": "example.com"
}
},
{
"comment": "Leading / is not stripped",
"href": "sc://example.com/",
"new_value": "///bad.com",
"expected": {
"href": "sc:///",
"host": "",
"hostname": ""
}
}
],
"port": [
Expand Down Expand Up @@ -1667,6 +1707,24 @@
"pathname": "/%23"
}
},
{
"comment": "? doesn't mess up encoding",
"href": "http://example.net",
"new_value": "/?é",
"expected": {
"href": "http://example.net/%3F%C3%A9",
"pathname": "/%3F%C3%A9"
}
},
{
"comment": "# doesn't mess up encoding",
"href": "http://example.net",
"new_value": "/#é",
"expected": {
"href": "http://example.net/%23%C3%A9",
"pathname": "/%23%C3%A9"
}
},
{
"comment": "File URLs and (back)slashes",
"href": "file://monkey/",
Expand Down
30 changes: 30 additions & 0 deletions testing/web-platform/tests/url/resources/urltestdata.json
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,36 @@
"search": "",
"hash": ""
},
{
"input": "\\x",
"base": "http://example.org/foo/bar",
"href": "http://example.org/x",
"origin": "http://example.org",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.org",
"hostname": "example.org",
"port": "",
"pathname": "/x",
"search": "",
"hash": ""
},
{
"input": "\\\\x\\hello",
"base": "http://example.org/foo/bar",
"href": "http://x/hello",
"origin": "http://x",
"protocol": "http:",
"username": "",
"password": "",
"host": "x",
"hostname": "x",
"port": "",
"pathname": "/hello",
"search": "",
"hash": ""
},
{
"input": "::",
"base": "http://example.org/foo/bar",
Expand Down

0 comments on commit df93b47

Please sign in to comment.