Bug 1454039 [wpt PR 10463] - Revert "Reland: Use PostTask to schedule cross-process postMessage forwarding.", a=testonly
authorBen Pastene <bpastene@chromium.org>
Sun, 22 Apr 2018 15:08:40 +0000
changeset 471426 2e40cf6fa01c585aedfb5e71c9a0233126f8a159
parent 471425 5a85849690304374b25e7d7b30d4dd77b0c8dc3c
child 471427 4bbea84414ab0ea6b8abfc02c682c9e6c02e647e
push id1728
push userjlund@mozilla.com
push dateMon, 18 Jun 2018 21:12:27 +0000
treeherdermozilla-release@c296fde26f5f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1454039, 10463, 999182, 832319, 828529, 550284, 1011287, 550621, 1012138, 550649
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 1454039 [wpt PR 10463] - Revert "Reland: Use PostTask to schedule cross-process postMessage forwarding.", a=testonly Automatic update from web-platform-testsRevert "Reland: Use PostTask to schedule cross-process postMessage forwarding." This reverts commit 7c3d1d13f940e88ef6706fd8b5c257a81d340ed9. Reason for revert: WebviewLoginTest.Basic is still flaky on linux-chromeos-rel https://ci.chromium.org/buildbot/chromium.chromiumos/linux-chromeos-rel/6886 https://ci.chromium.org/buildbot/chromium.chromiumos/linux-chromeos-rel/6887 Original change's description: > Reland: Use PostTask to schedule cross-process postMessage forwarding. > > Changes from original attempt at https://crrev.com/c/999182: > - fix flakiness in two additional ChromeOS login tests > - fix CSP WPT tests to not depend on ordering between iframe's onload > and postMessage - see https://crbug.com/832319. > > Previously, we sent the IPC to forward a cross-process postMessage > immediately. This caused a behavioral difference from the > same-process case where the postMessage is always scheduled. Namely, > in a scenario like this: > > frame.postMessage(...); > doSomethingThatSendsIPCsToFrame(frame); > > the IPCs from JS following the postMessage would've been ordered > incorrectly, causing |frame| to see their side effects after the > postMessage dispatch in the cross-process case, whereas they would be > seen before the postMessage dispatch in the same-process case. One > example of this is frame.focus(), and another is a frame element > onload event (dispatched via FrameHostMsg_DispatchLoad) arriving after > a postMessage dispatched from an inline script while the frame was > still loading. > > To resolve these ordering concerns, this CL changes cross-process > postMessage to do a PostTask on the sender side before sending the > message to the browser process. This improves the current state of > the world, but does not yet achieve a perfect match for the IPC > ordering in the same-process case - see discussion on the bug. > > Bug: 828529 > Change-Id: I62a627c501526d09900be4f5bd2c899acf4d1e07 > Reviewed-on: https://chromium-review.googlesource.com/999182 > Reviewed-by: Xiyuan Xia <xiyuan@chromium.org> > Reviewed-by: Daniel Cheng <dcheng@chromium.org> > Commit-Queue: Alex Moshchuk <alexmos@chromium.org> > Cr-Original-Commit-Position: refs/heads/master@{#550284} > Reviewed-on: https://chromium-review.googlesource.com/1011287 > Cr-Commit-Position: refs/heads/master@{#550621} TBR=xiyuan@chromium.org,dcheng@chromium.org,alexmos@chromium.org Change-Id: Ic0637a6038bed6e5334a26e1934bee81faad3b9e No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: 828529 Reviewed-on: https://chromium-review.googlesource.com/1012138 Reviewed-by: Ben Pastene <bpastene@chromium.org> Commit-Queue: Ben Pastene <bpastene@chromium.org> Cr-Commit-Position: refs/heads/master@{#550649} -- wpt-commits: 6ad1b51de7dce0d45d08cc0f47a92a7b1fed69d2 wpt-pr: 10463
testing/web-platform/meta/MANIFEST.json
testing/web-platform/tests/content-security-policy/embedded-enforcement/support/testharness-helper.sub.js
--- a/testing/web-platform/meta/MANIFEST.json
+++ b/testing/web-platform/meta/MANIFEST.json
@@ -423628,17 +423628,17 @@
    "363e06143474e3a3941fe4b96631146902351aff",
    "support"
   ],
   "content-security-policy/embedded-enforcement/support/echo-required-csp.py": [
    "8d73332cdc154e05cdfa936d3f6b936b9c0ebdba",
    "support"
   ],
   "content-security-policy/embedded-enforcement/support/testharness-helper.sub.js": [
-   "3f5930842625b190576a163cbe1a01aa8fc4c086",
+   "23feae559098474ba96b15f07619b9d7dba12dec",
    "support"
   ],
   "content-security-policy/font-src/font-match-allowed.sub.html": [
    "4bc23af2a5a3280630e50cc4c35a9769e499b7a6",
    "testharness"
   ],
   "content-security-policy/font-src/font-mismatch-blocked.sub.html": [
    "274372eb59cca6e399d8c786d7a0f443c6f35254",
--- a/testing/web-platform/tests/content-security-policy/embedded-enforcement/support/testharness-helper.sub.js
+++ b/testing/web-platform/tests/content-security-policy/embedded-enforcement/support/testharness-helper.sub.js
@@ -133,24 +133,18 @@ function assert_iframe_with_csp(t, url, 
     // Assert iframe loads with an expected violation.
     window.addEventListener('message', t.step_func(e => {
       if (e.source != i.contentWindow)
         return;
       assert_equals(e.data["blockedURI"], blockedURI);
       t.done();
     }));
   } else {
-    // Assert iframe loads.  Wait for both the load event and the postMessage.
-    window.addEventListener('message', t.step_func(e => {
-      if (e.source != i.contentWindow)
-        return;
-      assert_true(loaded[urlId]);
-      if (i.onloadReceived)
-        t.done();
-    }));
+    // Assert iframe loads.
     i.onload = t.step_func(function () {
-      if (loaded[urlId])
-        t.done();
-      i.onloadReceived = true;
+      // Delay the check until after the postMessage has a chance to execute.
+      setTimeout(t.step_func_done(function () {
+        assert_true(loaded[urlId]);
+      }), 1);
     });
   }
   document.body.appendChild(i);
 }