blob: 245afa97722b8da58a59b0e5d1e738f31bc8c034 [file] [log] [blame]
Test setting the pathname attribute of the URL in a URL object.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
Set pathname that starts with slash
PASS a.href is 'https://www.mydomain.com/path%20name?key=value'
Set pathname that does not start with slash and contains '?'
PASS a.href is 'https://www.mydomain.com/pa%3Fth?key=value'
Set pathname that starts with double slash and contains '#'
PASS a.href is 'https://www.mydomain.com//path%23name?key=value'
Set a pathname containing .. in it
PASS a.href is 'https://www.mydomain.com/path?key=value'
Set pathname to null
PASS a.href is 'https://www.mydomain.com/null?key=value'
Set pathname to empty string
PASS a.href is 'https://www.mydomain.com/?key=value'
Set pathname that includes illegal characters to URL that contains illegal characters.
PASS a.href = "https://www.my|d[]()omain.com/path/testurl.html?key=value" threw exception TypeError: Type error.
PASS a.href is 'https://www.mydomain.com/p$a|th?key=value'
Set pathname to URL that contains '@' in host
PASS a.href = "http://w@#ww" threw exception TypeError: Type error.
PASS a.href is 'https://www.mydomain.com/path?key=value'
Set pathname to a URL with non-hierarchical protocol
PASS a.href is 'tel:+1800-555-1212'
PASS successfullyParsed is true
TEST COMPLETE