From 3a331d2816cb597aa0e441b4536f0cd4ad80553b Mon Sep 17 00:00:00 2001 From: Anne van Kesteren Date: Fri, 3 Jun 2022 10:08:32 +0200 Subject: [PATCH 1/2] HTML: assert ErrorEventInit defaults This accounts for the change in https://github.com/whatwg/html/pull/7983 as well. --- .../document-synthetic-errorevent.html | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/html/webappapis/scripting/events/event-handler-processing-algorithm-error/document-synthetic-errorevent.html b/html/webappapis/scripting/events/event-handler-processing-algorithm-error/document-synthetic-errorevent.html index 8b1b3cfb5b2c33..9bb658f1cbffb8 100644 --- a/html/webappapis/scripting/events/event-handler-processing-algorithm-error/document-synthetic-errorevent.html +++ b/html/webappapis/scripting/events/event-handler-processing-algorithm-error/document-synthetic-errorevent.html @@ -21,6 +21,11 @@ const eventWatcher = new EventWatcher(t, document, "error"); const promise = eventWatcher.wait_for("error").then(e => { assert_equals(e.defaultPrevented, false); + assert_equals(e.message, ""); + assert_equals(e.filename, ""); + assert_equals(e.lineno, 0); + assert_equals(e.colno, 0); + assert_equals(e.error, undefined); }); document.dispatchEvent(new ErrorEvent("error", { cancelable: true })); From 4134a8d2fdac70c75dd43f4ef695793c2eba8fe3 Mon Sep 17 00:00:00 2001 From: Anne van Kesteren Date: Tue, 7 Jun 2022 08:50:58 +0200 Subject: [PATCH 2/2] test constructed event as well --- .../document-synthetic-errorevent.html | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/html/webappapis/scripting/events/event-handler-processing-algorithm-error/document-synthetic-errorevent.html b/html/webappapis/scripting/events/event-handler-processing-algorithm-error/document-synthetic-errorevent.html index 9bb658f1cbffb8..a541611909767a 100644 --- a/html/webappapis/scripting/events/event-handler-processing-algorithm-error/document-synthetic-errorevent.html +++ b/html/webappapis/scripting/events/event-handler-processing-algorithm-error/document-synthetic-errorevent.html @@ -32,4 +32,13 @@ return promise; }, "error event is normal (return true does not cancel; one arg) on Document, with a synthetic ErrorEvent"); + +test(() => { + const e = new ErrorEvent("error"); + assert_equals(e.message, ""); + assert_equals(e.filename, ""); + assert_equals(e.lineno, 0); + assert_equals(e.colno, 0); + assert_equals(e.error, undefined); +}, "Initial values of ErrorEvent members")