tor-browser

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

browser_utility_crashReporter.js (1044B)


      1 /* Any copyright is dedicated to the Public Domain.
      2 * http://creativecommons.org/publicdomain/zero/1.0/ */
      3 
      4 "use strict";
      5 
      6 async function startAndCrashUtility(numUnknownActors, actorsCheck) {
      7  const actors = Array(numUnknownActors).fill("unknown");
      8  const utilityPid = await startUtilityProcess(actors);
      9  await crashSomeUtility(utilityPid, actorsCheck);
     10 }
     11 
     12 // When running full suite, previous tests may have left some utility
     13 // processes running and this might interfere with our testing.
     14 add_setup(async function ensureNoExistingProcess() {
     15  await killUtilityProcesses();
     16 });
     17 
     18 add_task(async function utilityNoActor() {
     19  await startAndCrashUtility(0, actorNames => {
     20    return actorNames === undefined;
     21  });
     22 });
     23 
     24 add_task(async function utilityOneActor() {
     25  await startAndCrashUtility(1, actorNames => {
     26    return actorNames === kGenericUtilityActor;
     27  });
     28 });
     29 
     30 add_task(async function utilityManyActors() {
     31  await startAndCrashUtility(42, actorNames => {
     32    return actorNames === Array(42).fill("unknown").join(", ");
     33  });
     34 });