mirror of
https://github.com/servo/servo.git
synced 2025-06-26 18:14:34 +01:00
Update web-platform-tests to revision 313f99aafa6620894b8d7a7acc6e015b9548e179
This commit is contained in:
parent
7840614814
commit
54c2e735e6
77 changed files with 1067 additions and 217 deletions
|
@ -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>
|
|
@ -0,0 +1,2 @@
|
|||
import "./hello.js" assert { };
|
||||
log.push("empty-assertion-clause");
|
|
@ -0,0 +1,2 @@
|
|||
import "./hello.js#2" assert { type: "" };
|
||||
log.push("empty-type-assertion");
|
|
@ -0,0 +1 @@
|
|||
log.push("hello");
|
|
@ -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>
|
|
@ -0,0 +1,2 @@
|
|||
import "./hello.js#1" assert { type: "notARealType" };
|
||||
log.push("invalid-type-assertion");
|
|
@ -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>
|
|
@ -0,0 +1,2 @@
|
|||
import "./hello.js" assert { unsupportedAssertionKey: "unsupportedAssertionValue" };
|
||||
log.push("unsupported-assertion");
|
Loading…
Add table
Add a link
Reference in a new issue