fune/testing/web-platform/tests/webrtc/back-forward-cache-with-closed-webrtc-connection.https.window.js
Mingyu Lei f3648d42e8 Bug 1834254 [wpt PR 40117] - Add BFCache WPT for pages with WebSocket/WebTransport/WebRTC, a=testonly
Automatic update from web-platform-tests
Add BFCache WPT for pages with WebSocket/WebTransport/WebRTC

This CL adds some missing WPT for BFCache interaction with WebSocket,
WebTransport and WebRTC. The page should not be BFCached if there is
open connection correspondingly. After the connection is closed, the
page should be eligible for BFCache again.

Bug: 1446619
Change-Id: Id0b70afed08d3b2520767d09513b6a6c56afb744
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4551703
Reviewed-by: Nidhi Jaju <nidhijaju@chromium.org>
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Commit-Queue: Mingyu Lei <leimy@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1152289}

--

wpt-commits: 65879f9a5ea83b2bd28f096d36080c893116fa31
wpt-pr: 40117
2023-06-13 07:15:27 +00:00

19 lines
861 B
JavaScript

// META: title=Testing BFCache support for page with closed WebRTC connection.
// META: script=/common/dispatcher/dispatcher.js
// META: script=/common/utils.js
// META: script=/html/browsers/browsing-the-web/back-forward-cache/resources/rc-helper.js
// META: script=/html/browsers/browsing-the-web/remote-context-helper/resources/remote-context-helper.js
// META: script=resources/webrtc-test-helpers.sub.js
'use strict';
promise_test(async t => {
const rcHelper = new RemoteContextHelper();
// Open a window with noopener so that BFCache will work.
const rc1 = await rcHelper.addWindow(
/*config=*/ null, /*options=*/ { features: 'noopener' });
await openThenCloseWebRTC(rc1);
// The page should be eligible for BFCache because the WebRTC connection is closed.
await assertBFCacheEligibility(rc1, /*shouldRestoreFromBFCache=*/ true);
});