tor-browser

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

browser_aboutRestartRequired_buildid_true.js (1223B)


      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(expectedValueAfter) {
     11  setBuildidMismatchEnv();
     12  setBuildidMatchDontSendEnv();
     13  await forceCleanProcesses();
     14  let eventPromise = getEventPromise(
     15    "oop-browser-buildid-mismatch",
     16    "real-mismatch"
     17  );
     18  let tab = await openNewTab(false);
     19  await eventPromise;
     20  unsetBuildidMatchDontSendEnv();
     21  unsetBuildidMismatchEnv();
     22 
     23  is(
     24    await getTrueMismatchTelemetry(),
     25    expectedValueAfter,
     26    `Build ID true mismatch count should be ${expectedValueAfter}`
     27  );
     28 
     29  await closeTab(tab);
     30 }
     31 
     32 add_task(async function test_telemetry_restartrequired_real_mismatch() {
     33  // Do not clear telemetry's scalars, otherwise --verify will break because
     34  // the parent process will have kept memory of sent telemetry but that test
     35  // will not be aware
     36 
     37  info("Waiting for oop-browser-buildid-mismatch event.");
     38 
     39  // Run once
     40  await execTest(1);
     41  // Run a second time and make sure it has not increased
     42  await execTest(1);
     43 });