summaryrefslogtreecommitdiffstats
path: root/toolkit/crashreporter/test/unit/crasher_subprocess_tail.js
diff options
context:
space:
mode:
Diffstat (limited to 'toolkit/crashreporter/test/unit/crasher_subprocess_tail.js')
-rw-r--r--toolkit/crashreporter/test/unit/crasher_subprocess_tail.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/toolkit/crashreporter/test/unit/crasher_subprocess_tail.js b/toolkit/crashreporter/test/unit/crasher_subprocess_tail.js
new file mode 100644
index 000000000..8b4dd2b79
--- /dev/null
+++ b/toolkit/crashreporter/test/unit/crasher_subprocess_tail.js
@@ -0,0 +1,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);