blob: 177a99e2ce1d7f61c1fca5e2e87a9bc3dc6a1c9d [file] [log] [blame]
"use strict";
importScripts("/resources/testharness.js");
setup({ allow_uncaught_exception: true });
promise_test(t => {
self.onerror = t.step_func((...args) => {
assert_equals(args.length, 1);
return true;
});
const eventWatcher = new EventWatcher(t, self, "click");
const promise = eventWatcher.wait_for("click").then(e => {
assert_equals(e.defaultPrevented, false);
});
self.dispatchEvent(new ErrorEvent("click", { cancelable: true }));
return promise;
}, "error event is normal (return true does not cancel; one arg) on WorkerGlobalScope, with a synthetic ErrorEvent");
done();