Bug 1483768 [wpt PR 12511] - Modify expected state for test of window.event with listener from a different global, a=testonly
authorYuki Yamada <yukiy@google.com>
Fri, 17 Aug 2018 22:02:32 +0000
changeset 487484 5c5b8149502471859693734e3f7cf9c27d58a407
parent 487483 89f99e62d5dc796ba0d0be9d627b43d5053842a8
child 487485 bd7bd36d5ef40b5aa029d736678c8682d5e7b7a3
push id9719
push userffxbld-merge
push dateFri, 24 Aug 2018 17:49:46 +0000
treeherdermozilla-beta@719ec98fba77 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1483768, 12511, 1177216, 583581
milestone63.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 1483768 [wpt PR 12511] - Modify expected state for test of window.event with listener from a different global, a=testonly Automatic update from web-platform-testsModify expected state for test of window.event with listener from a different global Current wpt test of window.event checks global event on invoking a listener from a different global. The logic of the test is: 1. create an iframe element and set it as a child of parent window 2. add listeners 3. load event is dispatched in the context of child frame and a listener in the context of parent window is invoked 4. a event (named "hi") is dispatched inside the listener invoked in step 3. and a listener in the context of child frame is called 5. then check the global event of each context The test says that the global event of the parent context on step 5. should be undefined, but it should be load event that is dispatched step 3. in the logic above. This is because that events are dispatched synchronously by EventTarget.dispatchEvent() and that the global event of the context of some listener is set to the passed event before invoking the listener. (See: https://dom.spec.whatwg.org/#concept-event-listener-inner-invoke) These means that load event is still being processed while listeners for "hi" event is executed and that the global event of the parent window must be the load event. Therefore, this CL corrects that. Change-Id: I2116da87d06168b9fc113826311089e1e516e488 Reviewed-on: https://chromium-review.googlesource.com/1177216 Commit-Queue: Yuki Yamada <yukiy@google.com> Reviewed-by: Yuki Shiino <yukishiino@chromium.org> Reviewed-by: Kentaro Hara <haraken@chromium.org> Cr-Commit-Position: refs/heads/master@{#583581} -- wpt-commits: 27a88cc8a125d25e27fd9d49358b0dc8d445d103 wpt-pr: 12511
testing/web-platform/meta/MANIFEST.json
testing/web-platform/tests/dom/events/event-global-extra.window.js
--- a/testing/web-platform/meta/MANIFEST.json
+++ b/testing/web-platform/meta/MANIFEST.json
@@ -580175,17 +580175,17 @@
    "da2d7db3c4ddb53512cbf2d876d0212116b4a3e5",
    "testharness"
   ],
   "dom/events/event-disabled-dynamic.html": [
    "3f995b02f1b421f376dc6037d42c442307503fb2",
    "testharness"
   ],
   "dom/events/event-global-extra.window.js": [
-   "f26876966800121622b2d32ef86c955797c0141d",
+   "f457dd11fe80f69bea2309d47f8122f08e4487d4",
    "testharness"
   ],
   "dom/events/event-global.html": [
    "5cb1b1416aa35eb75a69be57b0bc8108d0fc7c93",
    "testharness"
   ],
   "dom/events/event-global.worker.js": [
    "116cf32932bd8dd0efba8b56a573028a9770d07b",
--- a/testing/web-platform/tests/dom/events/event-global-extra.window.js
+++ b/testing/web-platform/tests/dom/events/event-global-extra.window.js
@@ -70,21 +70,21 @@ test(t => {
   }));
   furtherChild.dispatchEvent(new Event("hi", { composed: true, bubbles: true }));
   assert_equals(counter, 4);
 }, "window.event should not be affected by nodes moving post-dispatch");
 
 async_test(t => {
   const frame = document.body.appendChild(document.createElement("iframe"));
   frame.src = "resources/event-global-extra-frame.html";
-  frame.onload = t.step_func_done(() => {
+  frame.onload = t.step_func_done((load_event) => {
     const event = new Event("hi");
     document.addEventListener("hi", frame.contentWindow.listener); // listener intentionally not wrapped in t.step_func
     document.addEventListener("hi", t.step_func(e => {
       assert_equals(event, e);
       assert_equals(window.event, e);
     }));
     document.dispatchEvent(event);
     assert_equals(frameState.event, event);
     assert_equals(frameState.windowEvent, event);
-    assert_equals(frameState.parentEvent, undefined);
+    assert_equals(frameState.parentEvent, load_event);
   });
 }, "Listener from a different global");