summaryrefslogtreecommitdiffstats
path: root/toolkit/crashreporter/test/unit/crasher_subprocess_tail.js
blob: c9e415b5671679fff39d3beee798e0cba6b6cde8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/* import-globals-from crasher_subprocess_head.js */

// Let the event loop process a bit before crashing.
if (shouldDelay) {
  let shouldCrashNow = false;

  Services.tm.dispatchToMainThread({
    run: () => {
      shouldCrashNow = true;
    },
  });

  Services.tm.spinEventLoopUntil(
    "Test(crasher_subprocess_tail.js:shouldDelay)",
    () => shouldCrashNow
  );
}

// now actually crash
CrashTestUtils.crash(crashType);