xref: /third_party/node/test/fixtures/wpt/dom/events/event-global.worker.js
  • Home
  • History
  • Annotate Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /third_party/node/test/fixtures/wpt/dom/events/
11cb0ef41Sopenharmony_ciimportScripts("/resources/testharness.js");
21cb0ef41Sopenharmony_citest(t => {
31cb0ef41Sopenharmony_ci  let seen = false;
41cb0ef41Sopenharmony_ci  const event = new Event("hi");
51cb0ef41Sopenharmony_ci  assert_equals(self.event, undefined);
61cb0ef41Sopenharmony_ci  self.addEventListener("hi", t.step_func(e => {
71cb0ef41Sopenharmony_ci    seen = true;
81cb0ef41Sopenharmony_ci    assert_equals(self.event, undefined);
91cb0ef41Sopenharmony_ci    assert_equals(e, event);
101cb0ef41Sopenharmony_ci  }));
111cb0ef41Sopenharmony_ci  self.dispatchEvent(event);
121cb0ef41Sopenharmony_ci  assert_true(seen);
131cb0ef41Sopenharmony_ci}, "There's no self.event (that's why we call it window.event) in workers");
141cb0ef41Sopenharmony_cidone();
15

Indexes created Thu Nov 07 10:32:03 CST 2024