Skip to content

Commit

Permalink
test: protocol setter and special URLs
Browse files Browse the repository at this point in the history
  • Loading branch information
joyeecheung committed Feb 2, 2017
1 parent 38511c4 commit ff0fccc
Showing 1 changed file with 43 additions and 4 deletions.
47 changes: 43 additions & 4 deletions test/fixtures/url-setter-tests.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@
" get the attribute `key` (invoke its getter).",
" The returned string must be equal to `value`.",
"",
"Note: the 'href' setter is already covered by urltestdata.json.",
"Source: https://github.com/w3c/web-platform-tests/tree/master/url"
"Note: the 'href' setter is already covered by urltestdata.json."
],
"protocol": [
{
Expand Down Expand Up @@ -104,14 +103,30 @@
}
},
{
"comment": "Can’t switch from special scheme to non-special. Note: this may change, see https://github.com/whatwg/url/issues/104",
"comment": "Can’t switch from special scheme to non-special",
"href": "http://example.net",
"new_value": "b",
"expected": {
"href": "http://example.net/",
"protocol": "http:"
}
},
{
"href": "https://example.net",
"new_value": "s",
"expected": {
"href": "https://example.net/",
"protocol": "https:"
}
},
{
"href": "ftp://example.net",
"new_value": "test",
"expected": {
"href": "ftp://example.net/",
"protocol": "ftp:"
}
},
{
"comment": "Cannot-be-a-base URL doesn’t have a host, but URL in a special scheme must.",
"href": "mailto:me@example.net",
Expand All @@ -122,14 +137,38 @@
}
},
{
"comment": "Can’t switch from non-special scheme to special. Note: this may change, see https://github.com/whatwg/url/issues/104",
"comment": "Can’t switch from non-special scheme to special",
"href": "ssh://me@example.net",
"new_value": "http",
"expected": {
"href": "ssh://me@example.net/",
"protocol": "ssh:"
}
},
{
"href": "ssh://me@example.net",
"new_value": "gopher",
"expected": {
"href": "ssh://me@example.net/",
"protocol": "ssh:"
}
},
{
"href": "ssh://me@example.net",
"new_value": "file",
"expected": {
"href": "ssh://me@example.net/",
"protocol": "ssh:"
}
},
{
"href": "nonsense:///test",
"new_value": "https",
"expected": {
"href": "nonsense:///test",
"protocol": "nonsense:"
}
},
{
"comment": "Stuff after the first ':' is ignored",
"href": "http://example.net",
Expand Down

0 comments on commit ff0fccc

Please sign in to comment.