Bug 1452709 [wpt PR 10382] - Test self.event in workers, a=testonly
authorAnne van Kesteren <annevk@annevk.nl>
Thu, 19 Apr 2018 11:16:30 +0000
changeset 468394 3838ac80516e937da4487e484094587ad3483348
parent 468393 3ff02137cf9f34ce14cdf832ca25824f25862f9d
child 468395 52c1493e53bcace9b8d5a5f3860d2f7f86622b3c
push id9165
push userasasaki@mozilla.com
push dateThu, 26 Apr 2018 21:04:54 +0000
treeherdermozilla-beta@064c3804de2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1452709, 10382, 10329
milestone61.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1452709 [wpt PR 10382] - Test self.event in workers, a=testonly Automatic update from web-platform-testsTest self.event in workers To compliment #10329. Needed for https://github.com/whatwg/dom/pull/407. -- wpt-commits: 3543c82551c1c1c152885844b00b0af0d0e38864 wpt-pr: 10382 wpt-commits: 3543c82551c1c1c152885844b00b0af0d0e38864 wpt-pr: 10382
testing/web-platform/meta/MANIFEST.json
testing/web-platform/tests/dom/events/event-global.worker.js
--- a/testing/web-platform/meta/MANIFEST.json
+++ b/testing/web-platform/meta/MANIFEST.json
@@ -322497,16 +322497,22 @@
     ]
    ],
    "dom/events/event-disabled-dynamic.html": [
     [
      "/dom/events/event-disabled-dynamic.html",
      {}
     ]
    ],
+   "dom/events/event-global.worker.js": [
+    [
+     "/dom/events/event-global.worker.html",
+     {}
+    ]
+   ],
    "dom/events/relatedTarget.window.js": [
     [
      "/dom/events/relatedTarget.window.html",
      {}
     ]
    ],
    "dom/historical.html": [
     [
@@ -549040,16 +549046,20 @@
   "dom/events/EventTarget-removeEventListener.html": [
    "8d195a4490df833fdd71388d9e8cc6e38d50cbd8",
    "testharness"
   ],
   "dom/events/event-disabled-dynamic.html": [
    "40ab5636653dfd105738ab38e7d22316132eb630",
    "testharness"
   ],
+  "dom/events/event-global.worker.js": [
+   "084a6f752edee6578113035fece6d0eb85a2fdf7",
+   "testharness"
+  ],
   "dom/events/relatedTarget.window.js": [
    "0426d2ecae3f3562be175e4364353d979365ed1c",
    "testharness"
   ],
   "dom/historical.html": [
    "ccf3d9d2d8eb3e7353ecedd8a4d8ba232f9374ec",
    "testharness"
   ],
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/dom/events/event-global.worker.js
@@ -0,0 +1,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();