Skip to content
Open
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
9 changes: 8 additions & 1 deletion test/fixtures/wpt/url/failure.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,15 @@
}, "URL's constructor's base argument: " + name)

self.test(() => {
const url = new URL("about:blank")
const original = "http://user:pass@example.com:8080/path?query#fragment"
const url = new URL(original)
assert_throws_js(TypeError, () => url.href = test.input)
const expected = new URL(original)
for (const property of ["href", "origin", "protocol", "username", "password", "host", "hostname", "port", "pathname", "search", "hash"]) {
assert_equals(url[property], expected[property], property)
}
url.hash = "changed"
assert_equals(url.href, "http://user:pass@example.com:8080/path?query#changed")
}, "URL's href: " + name)

// The following use cases resolve the URL input relative to the current
Expand Down
60 changes: 38 additions & 22 deletions test/fixtures/wpt/url/resources/IdnaTestV2.json
Original file line number Diff line number Diff line change
Expand Up @@ -7048,22 +7048,33 @@
"output": "j"
},
{
"comment": "C1; V7",
"comment": "C1",
"input": "\u10ad\ud8be\udccd\ua868\u05ae\u3002\u10be\u200c\u200c",
"output": null
},
{
"comment": "C1; V7",
"comment": "C1",
"input": "\u2d0d\ud8be\udccd\ua868\u05ae\u3002\u2d1e\u200c\u200c",
"output": null
},
{
"comment": "V7",
"input": "xn--5cb172r175fug38a.xn--mlj",
"output": "xn--5cb172r175fug38a.xn--mlj"
},
{
"comment": "C1; V7",
"input": "\u2d0d\ud8be\udccd\ua868\u05ae.\u2d1e",
"output": "xn--5cb172r175fug38a.xn--mlj"
},
{
"input": "\u10ad\ud8be\udccd\ua868\u05ae.\u10be",
"output": "xn--5cb172r175fug38a.xn--mlj"
},
{
"input": "\u10ad\ud8be\udccd\ua868\u05ae.\u2d1e",
"output": "xn--5cb172r175fug38a.xn--mlj"
},
{
"comment": "C1",
"input": "xn--5cb172r175fug38a.xn--0uga051h",
"output": "xn--5cb172r175fug38a.xn--0uga051h"
},
Expand Down Expand Up @@ -8238,67 +8249,67 @@
"output": "xn--ep37b.xn----hec165lho83b"
},
{
"comment": "C2; V6; V7",
"comment": "C2; V6",
"input": "\ud8bc\udc2b\uff0e\u1baa\u03c2\u10a6\u200d",
"output": null
},
{
"comment": "C2; V6; V7",
"comment": "C2; V6",
"input": "\ud8bc\udc2b.\u1baa\u03c2\u10a6\u200d",
"output": null
},
{
"comment": "C2; V6; V7",
"comment": "C2; V6",
"input": "\ud8bc\udc2b.\u1baa\u03c2\u2d06\u200d",
"output": null
},
{
"comment": "C2; V6; V7",
"comment": "C2; V6",
"input": "\ud8bc\udc2b.\u1baa\u03a3\u10a6\u200d",
"output": null
},
{
"comment": "C2; V6; V7",
"comment": "C2; V6",
"input": "\ud8bc\udc2b.\u1baa\u03c3\u2d06\u200d",
"output": null
},
{
"comment": "C2; V6; V7",
"comment": "C2; V6",
"input": "\ud8bc\udc2b.\u1baa\u03a3\u2d06\u200d",
"output": null
},
{
"comment": "V6; V7",
"comment": "V6",
"input": "xn--nu4s.xn--4xa153j7im",
"output": "xn--nu4s.xn--4xa153j7im"
},
{
"comment": "C2; V6; V7",
"comment": "C2; V6",
"input": "xn--nu4s.xn--4xa153jk8cs1q",
"output": "xn--nu4s.xn--4xa153jk8cs1q"
},
{
"comment": "C2; V6; V7",
"comment": "C2; V6",
"input": "xn--nu4s.xn--3xa353jk8cs1q",
"output": "xn--nu4s.xn--3xa353jk8cs1q"
},
{
"comment": "C2; V6; V7",
"comment": "C2; V6",
"input": "\ud8bc\udc2b\uff0e\u1baa\u03c2\u2d06\u200d",
"output": null
},
{
"comment": "C2; V6; V7",
"comment": "C2; V6",
"input": "\ud8bc\udc2b\uff0e\u1baa\u03a3\u10a6\u200d",
"output": null
},
{
"comment": "C2; V6; V7",
"comment": "C2; V6",
"input": "\ud8bc\udc2b\uff0e\u1baa\u03c3\u2d06\u200d",
"output": null
},
{
"comment": "C2; V6; V7",
"comment": "C2; V6",
"input": "\ud8bc\udc2b\uff0e\u1baa\u03a3\u2d06\u200d",
"output": null
},
Expand Down Expand Up @@ -11936,20 +11947,25 @@
"output": null
},
{
"comment": "V7",
"input": "\ud8ba\udcac\u3002\u0729\u3002\ucbd95",
"output": null
"output": "xn--t92s.xn--znb.xn--5-y88f"
},
{
"comment": "V7",
"input": "\ud8ba\udcac\u3002\u0729\u3002\u110d\u1173\u11ac5",
"output": null
"output": "xn--t92s.xn--znb.xn--5-y88f"
},
{
"comment": "V7",
"input": "xn--t92s.xn--znb.xn--5-y88f",
"output": "xn--t92s.xn--znb.xn--5-y88f"
},
{
"input": "\ud8ba\udcac.\u0729.\ucbd95",
"output": "xn--t92s.xn--znb.xn--5-y88f"
},
{
"input": "\ud8ba\udcac.\u0729.\u110d\u1173\u11ac5",
"output": "xn--t92s.xn--znb.xn--5-y88f"
},
{
"comment": "C2; V6",
"input": "\u17ca.\u200d\ud835\udfee\ud804\udc3f",
Expand Down
58 changes: 58 additions & 0 deletions test/fixtures/wpt/url/resources/setters_tests.json
Original file line number Diff line number Diff line change
Expand Up @@ -677,6 +677,16 @@
"port": "8080"
}
},
{
"href": "http://example.net:8080",
"new_value": "example.com:0",
"expected": {
"href": "http://example.com:0/",
"host": "example.com:0",
"hostname": "example.com",
"port": "0"
}
},
{
"comment": "Port number is unchanged if not specified",
"href": "http://example.net:8080",
Expand All @@ -697,6 +707,16 @@
"host": "example.net"
}
},
{
"href": "http://example.net:8080/path",
"new_value": ":example.com:15",
"expected": {
"href": "http://example.net:8080/path",
"host": "example.net:8080",
"hostname": "example.net",
"port": "8080"
}
},
{
"comment": "The empty host is OK for non-special schemes",
"href": "view-source+http://example.net/foo",
Expand Down Expand Up @@ -1066,6 +1086,16 @@
"port": ""
}
},
{
"href": "file:///x",
"new_value": "example.net",
"expected": {
"href": "file://example.net/x",
"host": "example.net",
"hostname": "example.net",
"port": ""
}
},
{
"href": "sc://test@test/",
"new_value": "",
Expand Down Expand Up @@ -1519,6 +1549,16 @@
"port": ""
}
},
{
"href": "file:///x",
"new_value": "example.net",
"expected": {
"href": "file://example.net/x",
"host": "example.net",
"hostname": "example.net",
"port": ""
}
},
{
"href": "sc://test@test/",
"new_value": "",
Expand Down Expand Up @@ -1693,6 +1733,16 @@
"port": ""
}
},
{
"href": "http://example.net:8080",
"new_value": "0",
"expected": {
"href": "http://example.net:0/",
"host": "example.net:0",
"hostname": "example.net",
"port": "0"
}
},
{
"comment": "Default port number is removed",
"href": "http://example.net:8080",
Expand Down Expand Up @@ -2034,6 +2084,14 @@
"pathname": "/home"
}
},
{
"href": "https://example.net/home#nav",
"new_value": "",
"expected": {
"href": "https://example.net/#nav",
"pathname": "/"
}
},
{
"comment": "\\ is a segment delimiter for 'special' URLs",
"href": "http://example.net/home?lang=fr#nav",
Expand Down
15 changes: 15 additions & 0 deletions test/fixtures/wpt/url/resources/urltestdata-javascript-only.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,20 @@
"pathname": "/%EF%BF%BD%F0%90%9F%BE%EF%BF%BD%EF%B7%90%EF%B7%8F%EF%B7%AF%EF%B7%B0%EF%BF%BE%EF%BF%BF",
"search": "?%EF%BF%BD%F0%90%9F%BE%EF%BF%BD%EF%B7%90%EF%B7%8F%EF%B7%AF%EF%B7%B0%EF%BF%BE%EF%BF%BF",
"hash": ""
},
{
"input": "b/c",
"base": "http://example.com/\uD801/b",
"href": "http://example.com/%EF%BF%BD/b/c",
"origin": "http://example.com",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.com",
"hostname": "example.com",
"port": "",
"pathname": "/%EF%BF%BD/b/c",
"search": "",
"hash": ""
}
]
Loading
Loading