back-forward-cache-with-closed-webrtc-connection.https.window.js (861B)
1 // META: title=Testing BFCache support for page with closed WebRTC connection. 2 // META: script=/common/dispatcher/dispatcher.js 3 // META: script=/common/utils.js 4 // META: script=/html/browsers/browsing-the-web/back-forward-cache/resources/rc-helper.js 5 // META: script=/html/browsers/browsing-the-web/remote-context-helper/resources/remote-context-helper.js 6 // META: script=resources/webrtc-test-helpers.sub.js 7 8 'use strict'; 9 10 promise_test(async t => { 11 const rcHelper = new RemoteContextHelper(); 12 13 // Open a window with noopener so that BFCache will work. 14 const rc1 = await rcHelper.addWindow( 15 /*config=*/ null, /*options=*/ { features: 'noopener' }); 16 await openThenCloseWebRTC(rc1); 17 // The page should be eligible for BFCache because the WebRTC connection is closed. 18 await assertBFCacheEligibility(rc1, /*shouldRestoreFromBFCache=*/ true); 19 });