tor-browser

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

browser_withoutDump.js (1081B)


      1 "use strict";
      2 
      3 const PAGE =
      4  "data:text/html,<html><body>A%20regular,%20everyday,%20normal%20page.";
      5 
      6 add_setup(async function () {
      7  prepareNoDump();
      8 });
      9 
     10 /**
     11 * Tests tab crash page when a dump is not available.
     12 */
     13 add_task(async function test_without_dump() {
     14  return BrowserTestUtils.withNewTab(
     15    {
     16      gBrowser,
     17      url: PAGE,
     18    },
     19    async function (browser) {
     20      let tab = gBrowser.getTabForBrowser(browser);
     21      await BrowserTestUtils.crashFrame(browser);
     22 
     23      let tabClosingPromise = BrowserTestUtils.waitForTabClosing(tab);
     24 
     25      await SpecialPowers.spawn(browser, [], async function () {
     26        let doc = content.document;
     27        Assert.ok(
     28          !doc.documentElement.classList.contains("crashDumpAvailable"),
     29          "doesn't have crash dump"
     30        );
     31 
     32        let options = doc.getElementById("options");
     33        Assert.ok(options, "has crash report options");
     34        Assert.ok(options.hidden, "crash report options are hidden");
     35 
     36        doc.getElementById("closeTab").click();
     37      });
     38 
     39      await tabClosingPromise;
     40    }
     41  );
     42 });