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