Update web-platform-tests to revision 313f99aafa6620894b8d7a7acc6e015b9548e179

This commit is contained in:
WPT Sync Bot 2021-01-07 08:21:05 +00:00
parent 7840614814
commit 54c2e735e6
77 changed files with 1067 additions and 217 deletions

View file

@ -0,0 +1,19 @@
<!DOCTYPE html>
<title>Handling of empty import assertion clause</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
window.log = [];
window.addEventListener("error", ev => log.push(ev.error));
const test_load = async_test(
"Test that no error occurs when an empty import assertion clause is provided.");
window.addEventListener("load", test_load.step_func_done(ev => {
assert_array_equals(window.log, ["hello", "empty-assertion-clause"]);
}));
function unreachable() { log.push("unexpected"); }
</script>
<script type="module" src="./empty-assertion-clause.js" onerror="unreachable()"></script>

View file

@ -0,0 +1,2 @@
import "./hello.js" assert { };
log.push("empty-assertion-clause");

View file

@ -0,0 +1,2 @@
import "./hello.js#2" assert { type: "" };
log.push("empty-type-assertion");

View file

@ -0,0 +1,24 @@
<!DOCTYPE html>
<title>Handling of invalid module type import assertions</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
setup({allow_uncaught_exception: true});
window.log = [];
window.addEventListener("error", ev => log.push(ev.error));
const test_load = async_test(
"Test that invalid module type assertion leads to TypeError on window.");
window.addEventListener("load", test_load.step_func_done(ev => {
assert_equals(log.length, 2);
assert_equals(log[0].constructor, TypeError);
assert_equals(log[1].constructor, TypeError);
}));
function unreachable() { log.push("unexpected"); }
</script>
<script type="module" src="./invalid-type-assertion.js" onerror="unreachable()"></script>
<script type="module" src="./empty-type-assertion.js" onerror="unreachable()"></script>

View file

@ -0,0 +1,2 @@
import "./hello.js#1" assert { type: "notARealType" };
log.push("invalid-type-assertion");

View file

@ -0,0 +1,19 @@
<!DOCTYPE html>
<title>Handling of unsupported assertion</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
window.log = [];
window.addEventListener("error", ev => log.push(ev.error));
const test_load = async_test(
"Test that no error occurs when an unsupported import assertion is provided.");
window.addEventListener("load", test_load.step_func_done(ev => {
assert_array_equals(window.log, ["hello", "unsupported-assertion"]);
}));
function unreachable() { log.push("unexpected"); }
</script>
<script type="module" src="./unsupported-assertion.js" onerror="unreachable()"></script>

View file

@ -0,0 +1,2 @@
import "./hello.js" assert { unsupportedAssertionKey: "unsupportedAssertionValue" };
log.push("unsupported-assertion");