tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

back-forward-cache-with-open-webrtc-connection.https.window.js (990B)


      1 // META: title=Testing BFCache support for page with open WebRTC connection and live MediaStreamTrack.
      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 // META: timeout=long
      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 openWebRTC(rc1);
     18  // The page should not be eligible for BFCache because of open WebRTC connection and live MediaStreamTrack.
     19  await assertBFCacheEligibility(rc1, /*shouldRestoreFromBFCache=*/ false);
     20  await assertNotRestoredFromBFCache(rc1, ['rtc', 'mediastream']);
     21 });