Bug 1694058 [wpt PR 27720] - [URL] Ensure that path-only URLs do not have their paths erased by th…, a=testonly

Automatic update from web-platform-tests
URL: pathname setter should not erase path-only URL paths

For https://github.com/whatwg/url/pull/582.

Co-authored-by: Anne van Kesteren <annevk@annevk.nl>
--

wpt-commits: 77d54aa9e0405f737987b59331f3584e3e1c26f9
wpt-pr: 27720
This commit is contained in:
Karl 2021-06-25 22:18:58 +00:00 коммит произвёл moz-wptsync-bot
Родитель 7b2bb69b24
Коммит 615cc1044e
1 изменённых файлов: 45 добавлений и 0 удалений

Просмотреть файл

@ -1611,6 +1611,51 @@
"pathname": "me@example.net"
}
},
{
"comment": "Special URLs cannot have their paths erased",
"href": "file:///some/path",
"new_value": "",
"expected": {
"href": "file:///",
"pathname": "/"
}
},
{
"comment": "Non-special URLs can have their paths erased",
"href": "foo://somehost/some/path",
"new_value": "",
"expected": {
"href": "foo://somehost",
"pathname": ""
}
},
{
"comment": "Non-special URLs with an empty host can have their paths erased",
"href": "foo:///some/path",
"new_value": "",
"expected": {
"href": "foo://",
"pathname": ""
}
},
{
"comment": "Path-only URLs cannot have their paths erased",
"href": "foo:/some/path",
"new_value": "",
"expected": {
"href": "foo:/",
"pathname": "/"
}
},
{
"comment": "Path-only URLs always have an initial slash",
"href": "foo:/some/path",
"new_value": "test",
"expected": {
"href": "foo:/test",
"pathname": "/test"
}
},
{
"href": "unix:/run/foo.socket?timeout=10",
"new_value": "/var/log/../run/bar.socket",