broadcastchannel.window.js (1022B)
1 // META: title=Ensure that open broadcastchannel does not block bfcache. 2 // META: script=/common/dispatcher/dispatcher.js 3 // META: script=/common/get-host-info.sub.js 4 // META: script=/common/utils.js 5 // META: script=/html/browsers/browsing-the-web/back-forward-cache/resources/rc-helper.js 6 // META: script=/html/browsers/browsing-the-web/remote-context-helper/resources/remote-context-helper.js 7 // META: script=/html/browsers/browsing-the-web/remote-context-helper-tests/resources/test-helper.js 8 // META: timeout=long 9 10 'use strict'; 11 12 promise_test(async t => { 13 const rcHelper = new RemoteContextHelper(); 14 // Open a window with noopener so that BFCache will work. 15 const rc1 = await rcHelper.addWindow( 16 /*extraConfig=*/ { 17 origin: 'HTTP_ORIGIN', 18 scripts: [], 19 headers: [], 20 }, 21 /*options=*/ {features: 'noopener'}); 22 await rc1.executeScript(() => { 23 window.foo = new BroadcastChannel('foo'); 24 }); 25 await assertBFCacheEligibility(rc1, /*shouldRestoreFromBfcache=*/ true); 26 });