Skip to content

Commit 9910784

Browse files
Olli Pettaymoz-wptsync-bot
authored andcommitted
Inside a WebWorker context, calling performance.addEventListener throws a generic NS_ERROR_FAILURE
Differential Revision: https://phabricator.services.mozilla.com/D97805 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1674254 gecko-commit: 4a4b3955d7aa4e4147e6f3aaf5f6fc8ddd5d8598 gecko-reviewers: barret
1 parent 831dc2b commit 9910784

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

hr-time/basic.any.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,12 @@ async_test(function() {
2626
this.done();
2727
}, 2000);
2828
}, 'High resolution time has approximately the right relative magnitude');
29+
30+
test(function() {
31+
var didHandle = false;
32+
self.performance.addEventListener("testEvent", function() {
33+
didHandle = true;
34+
}, { once: true} );
35+
self.performance.dispatchEvent(new Event("testEvent"));
36+
assert_true(didHandle, "Performance extends EventTarget, so event dispatching should work.");
37+
}, "Performance interface extends EventTarget.");

0 commit comments

Comments
 (0)