testing/web-platform/tests/portals/resources/portal-forward-with-broadcast.html
author Adithya Srinivasan <adithyas@chromium.org>
Tue, 12 Feb 2019 14:08:56 +0000
changeset 459262 09befdcd331f690d9044d82157802f1cc9e2ebbd
permissions -rw-r--r--
Bug 1526467 [wpt PR 15026] - Portals: Send detach message to browser process for portals, a=testonly Automatic update from web-platform-tests Portals: Send detach message to browser process for portals We don't currently send a message because the RenderFrameProxy created has no parent (so it looks like a main frame). This ensures that same-origin frames within the portal are also detached. The test added would fail with --enable-leak-detection without this change (the iframe inside the portal would leak). Bug: 923898 Change-Id: I2b56b8e303b40d275976da5ed8a0fdde7726b51c Reviewed-on: https://chromium-review.googlesource.com/c/1430586 Reviewed-by: Daniel Cheng <dcheng@chromium.org> Reviewed-by: Charlie Reis <creis@chromium.org> Reviewed-by: Lucas Gadani <lfg@chromium.org> Reviewed-by: Jeremy Roman <jbroman@chromium.org> Commit-Queue: Adithya Srinivasan <adithyas@chromium.org> Cr-Commit-Position: refs/heads/master@{#628179} -- wpt-commits: bf09c7c954ec1bf3860448d9db98d040c5ad5354 wpt-pr: 15026

<!DOCTYPE html>
<body>
  <script>
    function forwardMessage(e) {
      let broadcastChannel = new BroadcastChannel(new URL(location).searchParams.get('broadcastchannel'));
      try {
        broadcastChannel.postMessage(e.data);
      } finally {
        broadcastChannel.close();
      }
    }
    window.addEventListener("message", forwardMessage);
  </script>
</body>