From 8edaec79dea2f39a31ee97738dfa2e74911efe26 Mon Sep 17 00:00:00 2001 From: Andrew Kaster Date: Fri, 4 Oct 2024 16:11:00 -0600 Subject: [PATCH] LibWeb: Add a feature to LibWeb tests to fail on unhandled exceptions 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. --- .../LibWeb/Text/expected/all-window-properties.txt | 1 + Tests/LibWeb/Text/input/HTML/Window-onerror.html | 3 +++ .../WindowOrWorkerGlobalScope-reportError.html | 2 ++ Tests/LibWeb/Text/input/include.js | 14 ++++++++++++++ 4 files changed, 20 insertions(+) diff --git a/Tests/LibWeb/Text/expected/all-window-properties.txt b/Tests/LibWeb/Text/expected/all-window-properties.txt index a384a840793..8fa706e12ad 100644 --- a/Tests/LibWeb/Text/expected/all-window-properties.txt +++ b/Tests/LibWeb/Text/expected/all-window-properties.txt @@ -395,6 +395,7 @@ asyncTest printElement println promiseTest +removeTestErrorHandler spoofCurrentURL test timeout diff --git a/Tests/LibWeb/Text/input/HTML/Window-onerror.html b/Tests/LibWeb/Text/input/HTML/Window-onerror.html index 525f1f70a61..318ab4fd6d2 100644 --- a/Tests/LibWeb/Text/input/HTML/Window-onerror.html +++ b/Tests/LibWeb/Text/input/HTML/Window-onerror.html @@ -2,6 +2,9 @@