mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-19 08:15:31 +00:00
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:
parent
97820dc9b9
commit
bed2cd83f4
@ -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
|
||||
|
@ -0,0 +1 @@
|
||||
<link rel="match" href=about:blank>
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user