summaryrefslogtreecommitdiffstats
path: root/toolkit/crashreporter/test/unit/crasher_subprocess_tail.js
blob: 8b4dd2b79162908ea0a4b93f0b893b4e5a54b867 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// Let the event loop process a bit before crashing.
if (shouldDelay) {
  let shouldCrashNow = false;
  let thr = Components.classes["@mozilla.org/thread-manager;1"]
                          .getService().currentThread;
  thr.dispatch({ run: () => { shouldCrashNow = true; } },
               Components.interfaces.nsIThread.DISPATCH_NORMAL);

  while (!shouldCrashNow) {
    thr.processNextEvent(true);
  }
}

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