summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/dom/events/event-global.worker.js
blob: 116cf32932bd8dd0efba8b56a573028a9770d07b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
importScripts("/resources/testharness.js");
test(t => {
  let seen = false;
  const event = new Event("hi");
  assert_equals(self.event, undefined);
  self.addEventListener("hi", t.step_func(e => {
    seen = true;
    assert_equals(self.event, undefined);
    assert_equals(e, event);
  }));
  self.dispatchEvent(event);
  assert_true(seen);
}, "There's no self.event (that's why we call it window.event) in workers");
done();