summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/eligibility/broadcast-channel.html
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/eligibility/broadcast-channel.html')
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/eligibility/broadcast-channel.html23
1 files changed, 23 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/eligibility/broadcast-channel.html b/testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/eligibility/broadcast-channel.html
new file mode 100644
index 0000000000..bc04a5ed7f
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/eligibility/broadcast-channel.html
@@ -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>