back-forward-cache-with-closed-websocket-connection.window.js (925B)
1 // META: title=Testing BFCache support for page with closed WebSocket 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=/websockets/constants.sub.js 7 // META: script=resources/websockets-test-helpers.sub.js 8 9 'use strict'; 10 11 promise_test(async t => { 12 const rcHelper = new RemoteContextHelper(); 13 14 // Open a window with noopener so that BFCache will work. 15 const rc1 = await rcHelper.addWindow( 16 /*config=*/ null, /*options=*/ { features: 'noopener' }); 17 await openThenCloseWebSocket(rc1); 18 // The page should be eligible for BFCache because the WebSocket connection has been closed. 19 await assertBFCacheEligibility(rc1, /*shouldRestoreFromBFCache=*/ true); 20 });