tor-browser

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

abort-block-bfcache.window.js (756B)


      1 // META: title=Aborting a parser should block bfcache
      2 // META: script=./test-helper.js
      3 // META: timeout=long
      4 
      5 
      6 async_test(t => {
      7  if (!sessionStorage.getItem("pageVisited")) {
      8    // This is the first time loading the page.
      9    sessionStorage.setItem("pageVisited", 1);
     10    t.step_timeout(() => {
     11        // Go to another page and instantly come back to this page.
     12        location.href = new URL("../resources/going-back.html", window.location);
     13    }, 0);
     14    // Abort parsing in the middle of loading the page.
     15    window.stop();
     16  } else {
     17    const nrr = performance.getEntriesByType('navigation')[0].notRestoredReasons;
     18    assert_true(ReasonsInclude(nrr.reasons, "parser-aborted"));
     19    t.done();
     20  }
     21 }, "aborting a parser should block bfcache.");