mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-03 07:32:00 +00:00
Previously, if there was an unhandled exception in an async test, it might fail to call done() and timeout. Now we have a default "error" handler to catch unhandled exceptions and fail the test. A few tests want to actually test the behavior of window.onerror, so they need an escape hatch.
19 lines
405 B
HTML
19 lines
405 B
HTML
<!DOCTYPE html>
|
|
<script src="../include.js"></script>
|
|
<script>
|
|
asyncTest(done => {
|
|
|
|
removeTestErrorHandler()
|
|
|
|
window.addEventListener("error", (event) => {
|
|
println(`onerror event fired: ${event.error}`);
|
|
done();
|
|
});
|
|
|
|
try {
|
|
throw new Error("FAIL");
|
|
} catch (e) {}
|
|
|
|
throw new Error("Uncaught error");
|
|
});
|
|
</script>
|