Only test expected origin when it is present

https://github.com/w3c/web-platform-tests/pull/2584
This commit is contained in:
Simon Sapin 2016-04-22 14:33:15 +02:00
parent eee317352c
commit 7375e2cedd
3 changed files with 6 additions and 74 deletions

View file

@ -1,76 +1,4 @@
[url-constructor.html]
type: testharness
[Parsing: <file:/example.com/> against <http://example.org/foo/bar>]
expected: FAIL
[Parsing: <file:c:\\foo\\bar.html> against <file:///tmp/mock/path>]
expected: FAIL
[Parsing: < File:c|////foo\\bar.html> against <file:///tmp/mock/path>]
expected: FAIL
[Parsing: <C|/foo/bar> against <file:///tmp/mock/path>]
expected: FAIL
[Parsing: </C|\\foo\\bar> against <file:///tmp/mock/path>]
expected: FAIL
[Parsing: <//C|/foo/bar> against <file:///tmp/mock/path>]
expected: FAIL
[Parsing: <file:///foo/bar.txt> against <file:///tmp/mock/path>]
expected: FAIL
[Parsing: <file:///home/me> against <file:///tmp/mock/path>]
expected: FAIL
[Parsing: <//> against <file:///tmp/mock/path>]
expected: FAIL
[Parsing: <///> against <file:///tmp/mock/path>]
expected: FAIL
[Parsing: <///test> against <file:///tmp/mock/path>]
expected: FAIL
[Parsing: <test> against <file:///tmp/mock/path>]
expected: FAIL
[Parsing: <file:test> against <file:///tmp/mock/path>]
expected: FAIL
[Parsing: <file:/example.com/> against <about:blank>]
expected: FAIL
[Parsing: <//server/file> against <file:///tmp/mock/path>]
expected: FAIL
[Parsing: <\\\\server\\file> against <file:///tmp/mock/path>]
expected: FAIL
[Parsing: </\\server/file> against <file:///tmp/mock/path>]
expected: FAIL
[Parsing: <file://test> against <file:///tmp/mock/path>]
expected: FAIL
[Parsing: <file://localhost> against <file:///tmp/mock/path>]
expected: FAIL
[Parsing: <file://localhost/> against <file:///tmp/mock/path>]
expected: FAIL
[Parsing: <file://localhost/test> against <file:///tmp/mock/path>]
expected: FAIL
[Parsing: <file:...> against <http://www.example.com/test>]
expected: FAIL
[Parsing: <file:..> against <http://www.example.com/test>]
expected: FAIL
[Parsing: <file:a> against <http://www.example.com/test>]
expected: FAIL
[Parsing: <h\tt\nt\rp://h\to\ns\rt:9\t0\n0\r0/p\ta\nt\rh?q\tu\ne\rry#f\tr\na\rg> against <about:blank>]
expected: FAIL

View file

@ -38,7 +38,9 @@ function runURLTests(urltests) {
}
assert_equals(url.href, expected.href, "href")
assert_equals(url.origin, expected.origin, "origin")
if ("origin" in expected) {
assert_equals(url.origin, expected.origin, "origin")
}
assert_equals(url.protocol, expected.protocol, "protocol")
assert_equals(url.username, expected.username, "username")
assert_equals(url.password, expected.password, "password")

View file

@ -38,7 +38,9 @@ function runURLTests(urltests) {
var url = bURL(expected.input, expected.base)
assert_equals(url.href, expected.href, "href")
assert_equals(url.origin, expected.origin, "origin")
if ("origin" in expected) {
assert_equals(url.origin, expected.origin, "origin")
}
assert_equals(url.protocol, expected.protocol, "protocol")
assert_equals(url.username, expected.username, "username")
assert_equals(url.password, expected.password, "password")