tor-browser

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

browser_aboutRestartRequired_basic.js (1399B)


      1 "use strict";
      2 
      3 // On debug builds, crashing tabs results in much thinking, which
      4 // slows down the test and results in intermittent test timeouts,
      5 // so we'll pump up the expected timeout for this test.
      6 requestLongerTimeout(5);
      7 
      8 SimpleTest.expectChildProcessCrash();
      9 
     10 async function execTest() {
     11  is(
     12    await getFalsePositiveTelemetry(),
     13    undefined,
     14    "Build ID mismatch false positive count should be undefined"
     15  );
     16  is(
     17    await getTrueMismatchTelemetry(),
     18    undefined,
     19    "Build ID true mismatch count should be undefined"
     20  );
     21 
     22  await forceCleanProcesses();
     23  let eventPromise = getEventPromise("oop-browser-crashed", "basic");
     24  let tab = await openNewTab(true);
     25  await eventPromise;
     26 
     27  is(
     28    await getTrueMismatchTelemetry(),
     29    undefined,
     30    "Build ID true mismatch count should be undefined"
     31  );
     32  is(
     33    await getFalsePositiveTelemetry(),
     34    undefined,
     35    "Build ID mismatch false positive count should be undefined"
     36  );
     37 
     38  await closeTab(tab);
     39 }
     40 
     41 add_task(async function test_telemetry_restartrequired_no_mismatch() {
     42  // Do not clear telemetry's scalars, otherwise --verify will break because
     43  // the parent process will have kept memory of sent telemetry but that test
     44  // will not be aware
     45 
     46  info("Waiting for oop-browser-crashed event.");
     47 
     48  // Run once
     49  await execTest();
     50  // Run a second time and make sure it has not increased
     51  await execTest();
     52 });