tor-browser

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

performance-navigation-timing-navigation-failure.tentative.window.js (1123B)


      1 // META: title=Ensure that navigation failure blocks bfcache and gets recorded.
      2 // META: script=./test-helper.js
      3 // META: script=/common/dispatcher/dispatcher.js
      4 // META: script=/common/get-host-info.sub.js
      5 // META: script=/common/utils.js
      6 // META: script=/html/browsers/browsing-the-web/back-forward-cache/resources/rc-helper.js
      7 // META: script=/html/browsers/browsing-the-web/back-forward-cache/resources/404.py
      8 // META: script=/html/browsers/browsing-the-web/remote-context-helper/resources/remote-context-helper.js
      9 // META: timeout=long
     10 
     11 'use strict';
     12 const {ORIGIN} = get_host_info();
     13 
     14 promise_test(async t => {
     15  const rcHelper = new RemoteContextHelper();
     16  // Open a window with noopener so that BFCache will work.
     17  const rc1 = await rcHelper.addWindow(
     18      /*config=*/ {status: 404}, /*options=*/ {features: 'noopener'});
     19  const rc1_url = await rc1.executeScript(() => {
     20    return location.href;
     21  });
     22 
     23  // Check the BFCache result and the reported reasons.
     24  await assertBFCacheEligibility(rc1, /*shouldRestoreFromBFCache=*/ false);
     25  await assertNotRestoredFromBFCache(rc1, ['response-status-not-ok']);
     26 });