Skip to content

Commit

Permalink
HTML: assert ErrorEventInit defaults
Browse files Browse the repository at this point in the history
This accounts for the change in whatwg/html#7983 as well.
  • Loading branch information
annevk authored Jun 7, 2022
1 parent 111eba4 commit c297f88
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,24 @@
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 }));

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")
</script>

0 comments on commit c297f88

Please sign in to comment.