blob: f6a40c7e333f928379202e8131314c6354747158 [file] [log] [blame]
mjs@apple.com939e5e82014-01-31 23:06:25 +00001Test setting the hostname attribute of the URL in a URL object.
2
3On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
4
5
6Basic test
7PASS a.href is 'https://www.otherdomain.com:8080/path/'
8Extra slashes before hostname
9PASS a.href is 'https://www.otherdomain.com:8080/path/'
10Set hostname to URL with foo: protocol
11PASS a.href is 'foo://www.otherdomain.com/path/'
12Set hostname to null
cdumez@apple.com625bc932016-03-03 17:25:26 +000013PASS a.href is 'https://null:8080/path/'
mjs@apple.com939e5e82014-01-31 23:06:25 +000014Set hostname to empty string
15PASS a.href is 'https://www.mydomain.com:8080/path/'
16Set hostname to URL with 2 colons
17PASS a.href is 'really:bad:url'
18Set a hostname that contains space in it
19PASS a.href = "http://www.my domain.com/path/" threw exception TypeError: Type error.
darin@apple.com66d41182016-10-29 02:32:20 +000020PASS a.href is 'really:bad:url'
mjs@apple.com939e5e82014-01-31 23:06:25 +000021Set hostname on a local file
22FAIL a.href should be c:/path/testurl.html. Was c://a/path/testurl.html.
23Set hostname to undefined
24PASS a.href is 'https://undefined:8080/path/'
25PASS successfullyParsed is true
26
27TEST COMPLETE
28