mirror of
https://github.com/servo/servo.git
synced 2025-06-26 18:14:34 +01:00
Update web-platform-tests to revision 8cdb75336b65e31e0278082e74927e5be2045b5a
This commit is contained in:
parent
6164358bcd
commit
b0a5c77cf6
132 changed files with 1197 additions and 959 deletions
|
@ -9,19 +9,27 @@
|
|||
window.log = [];
|
||||
|
||||
window.addEventListener("error", ev => log.push(ev.error));
|
||||
window.addEventListener("onunhandledrejection", unreachable);
|
||||
|
||||
const test_load = async_test(
|
||||
"Test that exceptions during evaluation lead to error events on " +
|
||||
"window, and that exceptions are remembered.\n");
|
||||
window.addEventListener("load", test_load.step_func_done(ev => {
|
||||
const exn = log[1];
|
||||
assert_array_equals(log, ["throw", exn, exn, exn, exn]);
|
||||
assert_array_equals(log,
|
||||
["throw", exn, "load", exn, "load", exn, "load", exn, "load"]);
|
||||
assert_true(exn.foo);
|
||||
}));
|
||||
|
||||
function logLoad() { log.push("load") }
|
||||
|
||||
function unreachable() { log.push("unexpected"); }
|
||||
</script>
|
||||
<script type="module" src="throw.js" onerror="unreachable()"></script>
|
||||
<script type="module" src="throw.js" onerror="unreachable()"></script>
|
||||
<script type="module" src="throw.js" async onerror="unreachable()"></script>
|
||||
<script type="module" src="throw.js" nomodule onerror="unreachable()"></script>
|
||||
<script type="module" src="throw.js" onerror="unreachable()"
|
||||
onload="logLoad()"></script>
|
||||
<script type="module" src="throw.js" onerror="unreachable()"
|
||||
onload="logLoad()"></script>
|
||||
<script type="module" src="throw.js" async onerror="unreachable()"
|
||||
onload="logLoad()"></script>
|
||||
<script type="module" src="throw.js" nomodule onerror="unreachable()"
|
||||
onload="logLoad()"></script>
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
window.log = [];
|
||||
|
||||
window.addEventListener("error", ev => log.push(ev.error));
|
||||
window.addEventListener("onunhandledrejection", unreachable);
|
||||
|
||||
const test_load = async_test(
|
||||
"Test that ill-founded cyclic dependencies cause ReferenceError " +
|
||||
|
@ -16,12 +17,18 @@
|
|||
"exceptions are remembered.\n");
|
||||
window.addEventListener("load", test_load.step_func_done(ev => {
|
||||
const exn = log[1];
|
||||
assert_array_equals(log, ["cycle-tdz-access-a", exn, exn, exn]);
|
||||
assert_array_equals(log,
|
||||
["cycle-tdz-access-a", exn, "load", exn, "load", exn, "load"]);
|
||||
assert_equals(exn.constructor, ReferenceError);
|
||||
}));
|
||||
|
||||
function logLoad() { log.push("load"); }
|
||||
|
||||
function unreachable() { log.push("unexpected"); }
|
||||
</script>
|
||||
<script type="module" src="cycle-tdz-access.js" async onerror="unreachable()"></script>
|
||||
<script type="module" src="cycle-tdz-access.js" nomodule onerror="unreachable()"></script>
|
||||
<script type="module" src="cycle-tdz-access.js" onerror="unreachable()"></script>
|
||||
<script type="module" src="cycle-tdz-access.js" async onerror="unreachable()"
|
||||
onload="logLoad()"></script>
|
||||
<script type="module" src="cycle-tdz-access.js" nomodule onerror="unreachable()"
|
||||
onload="logLoad()"></script>
|
||||
<script type="module" src="cycle-tdz-access.js" onerror="unreachable()"
|
||||
onload="logLoad()"></script>
|
||||
|
|
|
@ -9,20 +9,29 @@
|
|||
window.log = [];
|
||||
|
||||
window.addEventListener("error", ev => log.push(ev.error));
|
||||
window.addEventListener("onunhandledrejection", unreachable);
|
||||
|
||||
const test_load = async_test(
|
||||
"Test that exceptions during evaluation lead to error events on " +
|
||||
"window, and that exceptions are remembered.\n");
|
||||
window.addEventListener("load", test_load.step_func_done(ev => {
|
||||
const exn = log[1];
|
||||
assert_array_equals(log, ["throw", exn, exn, exn, exn, exn]);
|
||||
assert_array_equals(log,
|
||||
["throw", exn, "load", exn, "load", exn, "load", exn, "load",
|
||||
exn, "load"]);
|
||||
assert_true(exn.foo);
|
||||
}));
|
||||
|
||||
function logLoad() { log.push("load"); }
|
||||
function unreachable() { log.push("unexpected"); }
|
||||
</script>
|
||||
<script type="module" src="./throw.js" onerror="unreachable()"></script>
|
||||
<script type="module" src="./throw.js" onerror="unreachable()"></script>
|
||||
<script type="module" src="./throw-nested.js" onerror="unreachable()"></script>
|
||||
<script type="module" src="./throw.js" onerror="unreachable()"></script>
|
||||
<script type="module" src="./throw-nested.js" onerror="unreachable()"></script>
|
||||
<script type="module" src="./throw.js" onerror="unreachable()"
|
||||
onload="logLoad()"></script>
|
||||
<script type="module" src="./throw.js" onerror="unreachable()"
|
||||
onload="logLoad()"></script>
|
||||
<script type="module" src="./throw-nested.js" onerror="unreachable()"
|
||||
onload="logLoad()"></script>
|
||||
<script type="module" src="./throw.js" onerror="unreachable()"
|
||||
onload="logLoad()"></script>
|
||||
<script type="module" src="./throw-nested.js" onerror="unreachable()"
|
||||
onload="logLoad()"></script>
|
||||
|
|
|
@ -9,20 +9,29 @@
|
|||
window.log = [];
|
||||
|
||||
window.addEventListener("error", ev => log.push(ev.error));
|
||||
window.addEventListener("onunhandledrejection", unreachable);
|
||||
|
||||
const test_load = async_test(
|
||||
"Test that exceptions during evaluation lead to error events on " +
|
||||
"window, and that exceptions are remembered.\n");
|
||||
window.addEventListener("load", test_load.step_func_done(ev => {
|
||||
const exn = log[1];
|
||||
assert_array_equals(log, ["throw", exn, exn, exn, exn, exn]);
|
||||
assert_array_equals(log,
|
||||
["throw", exn, "load", exn, "load", exn, "load", exn, "load",
|
||||
exn, "load"]);
|
||||
assert_true(exn.foo);
|
||||
}));
|
||||
|
||||
function logLoad() { log.push("load"); }
|
||||
function unreachable() { log.push("unexpected"); }
|
||||
</script>
|
||||
<script type="module" src="./throw-nested.js" onerror="unreachable()"></script>
|
||||
<script type="module" src="./throw-nested.js" onerror="unreachable()"></script>
|
||||
<script type="module" src="./throw.js" onerror="unreachable()"></script>
|
||||
<script type="module" src="./throw-nested.js" onerror="unreachable()"></script>
|
||||
<script type="module" src="./throw.js" onerror="unreachable()"></script>
|
||||
<script type="module" src="./throw-nested.js" onerror="unreachable()"
|
||||
onload="logLoad()"></script>
|
||||
<script type="module" src="./throw-nested.js" onerror="unreachable()"
|
||||
onload="logLoad()"></script>
|
||||
<script type="module" src="./throw.js" onerror="unreachable()"
|
||||
onload="logLoad()"></script>
|
||||
<script type="module" src="./throw-nested.js" onerror="unreachable()"
|
||||
onload="logLoad()"></script>
|
||||
<script type="module" src="./throw.js" onerror="unreachable()"
|
||||
onload="logLoad()"></script>
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
import "/resources/testharness.js";
|
||||
import "./evaluation-order-setup.mjs";
|
||||
|
||||
import "./evaluation-order-1-nothrow-worker.mjs";
|
||||
|
||||
import "./evaluation-order-1-nothrow.mjs";
|
|
@ -0,0 +1,10 @@
|
|||
<!DOCTYPE html>
|
||||
<title>Testing evaluation order</title>
|
||||
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script>
|
||||
const worker = new Worker(
|
||||
"evaluation-order-1-nothrow-worker-setup.mjs", {type:"module"});
|
||||
fetch_tests_from_worker(worker);
|
||||
</script>
|
|
@ -0,0 +1,7 @@
|
|||
globalThis.expectedLog = [
|
||||
"step-1-1", "step-1-2",
|
||||
"microtask",
|
||||
];
|
||||
|
||||
globalThis.test_load.step_timeout(() => globalThis.testDone(), 0);
|
||||
done();
|
|
@ -0,0 +1,19 @@
|
|||
<!DOCTYPE html>
|
||||
<title>Testing evaluation order</title>
|
||||
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script type="module">
|
||||
import "./evaluation-order-setup.mjs";
|
||||
window.addEventListener("load", ev => globalThis.testDone());
|
||||
globalThis.expectedLog = [
|
||||
"step-1-1", "step-1-2",
|
||||
"microtask",
|
||||
"script-load",
|
||||
"global-load",
|
||||
];
|
||||
</script>
|
||||
|
||||
<script type="module" src="evaluation-order-1-nothrow.mjs"
|
||||
onerror="globalThis.unreachable()"
|
||||
onload="globalThis.log.push('script-load')"></script>
|
|
@ -0,0 +1,3 @@
|
|||
globalThis.log.push("step-1-1");
|
||||
queueMicrotask(() => globalThis.log.push("microtask"));
|
||||
globalThis.log.push("step-1-2");
|
|
@ -0,0 +1,6 @@
|
|||
import "/resources/testharness.js";
|
||||
import "./evaluation-order-setup.mjs";
|
||||
|
||||
import "./evaluation-order-1-worker.mjs";
|
||||
|
||||
import "./evaluation-order-1.mjs";
|
|
@ -0,0 +1,10 @@
|
|||
<!DOCTYPE html>
|
||||
<title>Testing evaluation order</title>
|
||||
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script>
|
||||
const worker = new Worker(
|
||||
"evaluation-order-1-worker-setup.mjs", {type:"module"});
|
||||
fetch_tests_from_worker(worker);
|
||||
</script>
|
|
@ -0,0 +1,9 @@
|
|||
globalThis.expectedLog = [
|
||||
"step-1-1", "step-1-2",
|
||||
"global-error", "error",
|
||||
"microtask",
|
||||
];
|
||||
|
||||
globalThis.test_load.step_timeout(() => globalThis.testDone(), 0);
|
||||
|
||||
done();
|
|
@ -0,0 +1,20 @@
|
|||
<!DOCTYPE html>
|
||||
<title>Testing evaluation order</title>
|
||||
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
|
||||
<script type="module">
|
||||
import "./evaluation-order-setup.mjs";
|
||||
window.addEventListener("load", event => globalThis.testDone());
|
||||
globalThis.expectedLog = [
|
||||
"step-1-1", "step-1-2",
|
||||
"global-error", "error",
|
||||
"microtask",
|
||||
"script-load",
|
||||
"global-load"
|
||||
];
|
||||
</script>
|
||||
|
||||
<script type="module" src="evaluation-order-1.mjs"
|
||||
onerror="unreachable()" onload="log.push('script-load')"></script>
|
|
@ -0,0 +1,5 @@
|
|||
globalThis.log.push("step-1-1");
|
||||
queueMicrotask(() => log.push("microtask"));
|
||||
globalThis.log.push("step-1-2");
|
||||
|
||||
throw new Error("error");
|
|
@ -0,0 +1,6 @@
|
|||
import "/resources/testharness.js";
|
||||
import "./evaluation-order-setup.mjs";
|
||||
|
||||
import "./evaluation-order-2-import-worker.mjs";
|
||||
|
||||
import "./evaluation-order-2.1.mjs";
|
|
@ -0,0 +1,10 @@
|
|||
<!DOCTYPE html>
|
||||
<title>Testing evaluation order</title>
|
||||
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script>
|
||||
const worker = new Worker(
|
||||
"evaluation-order-2-import-worker-setup.mjs", {type:"module"});
|
||||
fetch_tests_from_worker(worker);
|
||||
</script>
|
|
@ -0,0 +1,7 @@
|
|||
globalThis.expectedLog = [
|
||||
"step-2.2-1", "step-2.2-2",
|
||||
"microtask-2.2",
|
||||
"global-error", "error",
|
||||
];
|
||||
|
||||
done();
|
|
@ -0,0 +1,20 @@
|
|||
<!DOCTYPE html>
|
||||
<title>Testing evaluation order</title>
|
||||
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script type="module">
|
||||
import "./evaluation-order-setup.mjs";
|
||||
globalThis.expectedLog = [
|
||||
"step-2.2-1", "step-2.2-2",
|
||||
"global-error", "error",
|
||||
"microtask-2.2",
|
||||
"script-load",
|
||||
"global-load",
|
||||
];
|
||||
</script>
|
||||
|
||||
<script type="module" src="evaluation-order-2.1.mjs"
|
||||
onerror="globalThis.unreachable()"
|
||||
onload="globalThis.log.push('script-load')">
|
||||
</script>
|
|
@ -0,0 +1,8 @@
|
|||
globalThis.log.push("step-2.1-1");
|
||||
queueMicrotask(() => globalThis.log.push("microtask-2.1"));
|
||||
globalThis.log.push("step-2.1-2");
|
||||
|
||||
// import is evaluated first.
|
||||
import "./evaluation-order-2.2.mjs";
|
||||
|
||||
globalThis.log.push("step-2.1-3");
|
|
@ -0,0 +1,7 @@
|
|||
globalThis.log.push("step-2.2-1");
|
||||
queueMicrotask(() => globalThis.log.push("microtask-2.2"));
|
||||
globalThis.log.push("step-2.2-2");
|
||||
|
||||
globalThis.test_load.step_timeout(() => globalThis.testDone(), 0);
|
||||
|
||||
throw new Error("error");
|
|
@ -0,0 +1,6 @@
|
|||
import "/resources/testharness.js";
|
||||
import "./evaluation-order-setup.mjs";
|
||||
|
||||
import "./evaluation-order-3-dynamic-worker.mjs";
|
||||
|
||||
import "./evaluation-order-3.1.mjs";
|
|
@ -0,0 +1,11 @@
|
|||
<!DOCTYPE html>
|
||||
|
||||
<title>Testing evaluation order</title>
|
||||
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script>
|
||||
const worker = new Worker(
|
||||
"evaluation-order-3-dynamic-worker-setup.mjs", {type:"module"});
|
||||
fetch_tests_from_worker(worker);
|
||||
</script>
|
|
@ -0,0 +1,8 @@
|
|||
globalThis.expectedLog = [
|
||||
"step-3.1-1", "step-3.1-2", "step-3.1-3",
|
||||
"microtask-3.1",
|
||||
"step-3.2-1", "step-3.2-2",
|
||||
"microtask-3.2",
|
||||
"import-catch", "error",
|
||||
];
|
||||
done();
|
|
@ -0,0 +1,19 @@
|
|||
<!DOCTYPE html>
|
||||
<title>Testing evaluation order</title>
|
||||
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script type="module">
|
||||
import "./evaluation-order-setup.mjs";
|
||||
globalThis.expectedLog = [
|
||||
"step-3.1-1", "step-3.1-2", "step-3.1-3", "microtask-3.1",
|
||||
"script-load",
|
||||
"step-3.2-1", "step-3.2-2", "microtask-3.2",
|
||||
"import-catch", "error"
|
||||
];
|
||||
</script>
|
||||
|
||||
<script type="module" src="evaluation-order-3.1.mjs"
|
||||
onerror="globalThis.unreachable()"
|
||||
onload="globalThis.log.push('script-load')">
|
||||
</script>
|
|
@ -0,0 +1,11 @@
|
|||
globalThis.log.push("step-3.1-1");
|
||||
queueMicrotask(() => globalThis.log.push("microtask-3.1"));
|
||||
globalThis.log.push("step-3.1-2");
|
||||
|
||||
import("./evaluation-order-3.2.mjs").catch(
|
||||
exception => {
|
||||
globalThis.log.push("import-catch", exception.message);
|
||||
globalThis.testDone();
|
||||
});
|
||||
|
||||
globalThis.log.push("step-3.1-3");
|
|
@ -0,0 +1,5 @@
|
|||
globalThis.log.push("step-3.2-1");
|
||||
queueMicrotask(() => globalThis.log.push("microtask-3.2"));
|
||||
globalThis.log.push("step-3.2-2");
|
||||
|
||||
throw new Error("error");
|
|
@ -0,0 +1,19 @@
|
|||
globalThis.setup({allow_uncaught_exception: true});
|
||||
|
||||
globalThis.log = [];
|
||||
|
||||
globalThis.addEventListener("error",
|
||||
event => globalThis.log.push("global-error", event.error.message));
|
||||
globalThis.addEventListener("onunhandledrejection",
|
||||
event => globalThis.log.push('unhandled-promise-rejection'));
|
||||
globalThis.addEventListener("load",
|
||||
event => globalThis.log.push("global-load"));
|
||||
|
||||
globalThis.unreachable = function() {
|
||||
globalThis.log.push("unreachable");
|
||||
}
|
||||
|
||||
globalThis.test_load = async_test("Test evaluation order of modules");
|
||||
globalThis.testDone = globalThis.test_load.step_func_done(() => {
|
||||
assert_array_equals(globalThis.log, globalThis.expectedLog);
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue