Bug 1436412 [wpt PR 9421] - Fix #8806: Allow about:blank as reference URL, a=testonly

Automatic update from web-platform-testsFix #8806: Allow about:blank as reference URL (#9421)

wpt-commits: c23fdbd54d77d54d7a0a51813caa91897f4d6b0d
wpt-pr: 9421
wpt-commits: c23fdbd54d77d54d7a0a51813caa91897f4d6b0d
wpt-pr: 9421
This commit is contained in:
Vedant Chakravadhanula 2018-03-26 12:17:36 +00:00 committed by James Graham
parent 97820dc9b9
commit bed2cd83f4
3 changed files with 12 additions and 1 deletions

View File

@ -430,7 +430,7 @@ def check_parsed(repo_root, path, f):
for reftest_node in source_file.reftest_nodes:
href = reftest_node.attrib.get("href", "").strip(space_chars)
parts = urlsplit(href)
if parts.scheme or parts.netloc:
if (parts.scheme or parts.netloc) and parts != urlsplit("about:blank"):
errors.append(("ABSOLUTE-URL-REF",
"Reference test with a reference file specified via an absolute URL: '%s'" % href, path, None))
continue

View File

@ -0,0 +1 @@
<link rel="match" href=about:blank>

View File

@ -213,6 +213,16 @@ def test_ref_absolute_url(caplog):
assert "ref/absolute.html" in caplog.text
def test_about_blank_as_ref(caplog):
with _mock_lint("check_path") as mocked_check_path:
with _mock_lint("check_file_contents") as mocked_check_file_contents:
rv = lint(_dummy_repo, ["about_blank-ref.html"], "normal")
assert rv == 0
assert not mocked_check_path.called
assert not mocked_check_file_contents.called
assert caplog.text == ""
def test_ref_same_file_empty(caplog):
with _mock_lint("check_path") as mocked_check_path:
with _mock_lint("check_file_contents") as mocked_check_file_contents: