tor-browser

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

browser_bug1674464.js (1268B)


      1 const DUMMY_1 =
      2  // eslint-disable-next-line @microsoft/sdl/no-insecure-url
      3  "http://example.org/browser/docshell/test/browser/dummy_page.html";
      4 const DUMMY_2 =
      5  // eslint-disable-next-line @microsoft/sdl/no-insecure-url
      6  "http://example.com/browser/docshell/test/browser/dummy_page.html";
      7 
      8 add_task(async function test_backAndReload() {
      9  await BrowserTestUtils.withNewTab(
     10    { gBrowser, url: DUMMY_1 },
     11    async function (browser) {
     12      await BrowserTestUtils.crashFrame(browser);
     13 
     14      info("Start second load.");
     15      BrowserTestUtils.startLoadingURIString(browser, DUMMY_2);
     16      await BrowserTestUtils.waitForLocationChange(gBrowser, DUMMY_2);
     17 
     18      browser.goBack();
     19      await BrowserTestUtils.waitForLocationChange(gBrowser);
     20 
     21      is(
     22        browser.browsingContext.childSessionHistory.index,
     23        0,
     24        "We should have gone back to the first page"
     25      );
     26      is(
     27        browser.browsingContext.childSessionHistory.count,
     28        2,
     29        "If a tab crashes after a load has finished we shouldn't have an entry for about:tabcrashed"
     30      );
     31      is(
     32        browser.documentURI.spec,
     33        DUMMY_1,
     34        "If a tab crashes after a load has finished we shouldn't have an entry for about:tabcrashed"
     35      );
     36    }
     37  );
     38 });