mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-08-22 20:33:10 +09:00
15 lines
467 B
JavaScript
15 lines
467 B
JavaScript
// 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);
|