Update web-platform-tests to revision a5cb9597799c5f9bf0a809006161a0c50055828f

This commit is contained in:
WPT Sync Bot 2020-06-09 08:20:32 +00:00
parent 8b56b7a3c2
commit 2a42c14544
646 changed files with 93200 additions and 2587 deletions

View file

@ -0,0 +1,61 @@
<!DOCTYPE html>
<title>A link element with rel="webbundle"</title>
<link
rel="help"
href="https://github.com/WICG/webpackage/blob/master/explainers/subresource-loading.md"
/>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<body>
<link id="link_empty" />
<link id="link_web_bundle_1" rel="webbundle" />
<link id="link_web_bundle_2" rel="webbundle" resources="foo" />
<script>
test(() => {
assert_false(
"resources" in Element.prototype,
"resources must not be defined on Element prototype"
);
assert_true(
"resources" in HTMLLinkElement.prototype,
"resources must be defined on HTMLLinkElement prototype"
);
}, "resources must be defined on HTMLLinkElement prototype");
test(() => {
const link = document.createElement("link");
assert_true(link.relList.supports("webbundle"));
}, "webbundle must be a supported token of a link element's relList");
test(() => {
const link_web_bundle = document.querySelector("#link_web_bundle_1");
assert_equals(
link_web_bundle.getAttribute("rel"),
"webbundle",
"rel attribute must return webbundle"
);
assert_true(
link_web_bundle.relList.contains("webbundle"),
"relList must contain webbundle for <link rel=webbundle>."
);
assert_false(
document.querySelector("#link_empty").relList.contains("webbundle"),
"relList must not contain webbundle for <link>"
);
}, "relList must contain webbundle if rel attribute contains it");
test(() => {
assert_equals(
document.querySelector("#link_web_bundle_1").getAttribute("resources"),
null,
"resources attribute must return null when the attribute is not given"
);
assert_equals(
document.querySelector("#link_web_bundle_2").getAttribute("resources"),
"foo",
"resources attribute must return the specified value"
);
// TODO: Test more variant of resoruces attribute values.
}, "resoruces attribute must return null or specified value");
</script>
</body>