Skip to content

Commit

Permalink
Bug 1733857 [wpt PR 31079] - [WPT] BFCache eligibility: BroadcastChan…
Browse files Browse the repository at this point in the history
…nel, a=testonly

Automatic update from web-platform-tests
[WPT] BFCache eligibility: BroadcastChannel

When there are open BroadcastChannels at the time of navigation,

Chrome: The page is not BFCached.
        The page is BFCached if BroadcastChannels are closed
        in the pagehide event.
Firefox: The page is BFCached.
Safari: BroadcastChannel is not supported.

Bug: 1107415, whatwg/html#7219
Change-Id: I25afa41274278b0976ad1fa0fdd50015a3f6ce77
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3201012
Reviewed-by: Fergal Daly <[email protected]>
Reviewed-by: Yuzu Saijo <[email protected]>
Commit-Queue: Hiroshige Hayashizaki <[email protected]>
Cr-Commit-Position: refs/heads/main@{#956437}

--

wpt-commits: 22074adb41b750abd820301fd731b29d0c9e8793
wpt-pr: 31079
  • Loading branch information
hiroshige-g authored and moz-wptsync-bot committed Jan 11, 2022
1 parent a9fb1a0 commit 0cc6b16
Showing 1 changed file with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<!DOCTYPE HTML>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/common/utils.js"></script>
<script src="/common/dispatcher/dispatcher.js"></script>
<script src="../resources/helper.sub.js"></script>
<script>
// Check whether the page is BFCached when there are open BroadcastChannels.
// See https://github.com/whatwg/html/issues/7219 for other related scenarios.
runEventTest(
{funcBeforeNavigation: () => {
window.bc = new BroadcastChannel('foo');
}},
'Eligibility (BroadcastChannel)');

// Same as above, but the BroadcastChannels are closed in the pagehide event.
runEventTest(
{funcBeforeNavigation: () => {
window.bc = new BroadcastChannel('foo');
window.addEventListener('pagehide', () => window.bc.close());
}},
'Eligibility (BroadcastChannel closed in the pagehide event)');
</script>

0 comments on commit 0cc6b16

Please sign in to comment.