blob: f71c2671f3ce8981009822400a080a1a57f4b8a0 [file] [log] [blame]
Test setting the port attribute of the URL in HTMLAnchorElement.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
Default port as number
PASS a.href is 'https://www.mydomain.com/path/testurl.html?key=value'
Default port as string
PASS a.href is 'https://www.mydomain.com/path/testurl.html?key=value'
Set port to 0
PASS a.href is 'https://www.mydomain.com:0/path/testurl.html?key=value'
Set port to non-number
PASS a.href is 'https://www.mydomain.com:4/path/testurl.html?key=value'
Set port to null
PASS a.href is 'https://www.mydomain.com:0/path/testurl.html?key=value'
Set port to empty string
PASS a.href is 'https://www.mydomain.com:0/path/testurl.html?key=value'
Set port to undefined
PASS a.href is 'https://www.mydomain.com:0/path/testurl.html?key=value'
Set port to URL with foo: protocol
FAIL a.href should be foo://bar:50/. Was foo://bar/.
PASS successfullyParsed is true
TEST COMPLETE