diff --git a/dom/ipc/tests/chrome.ini b/dom/ipc/tests/chrome.ini index 1f0bc2995445..206f0a150119 100644 --- a/dom/ipc/tests/chrome.ini +++ b/dom/ipc/tests/chrome.ini @@ -5,3 +5,7 @@ support-files = [test_process_error.xhtml] skip-if = !crashreporter + + +[test_process_error_oom.xhtml] +skip-if = !crashreporter diff --git a/dom/ipc/tests/process_error.xhtml b/dom/ipc/tests/process_error.xhtml index a074f33b6def..a017508b9482 100644 --- a/dom/ipc/tests/process_error.xhtml +++ b/dom/ipc/tests/process_error.xhtml @@ -14,6 +14,10 @@ const done = window.arguments[0].done; const SimpleTest = window.arguments[0].SimpleTest; + // Parse test options. + const url = new URL(document.location); + const crashType = url.searchParams.get("crashType"); + // Allow the browser to get connected before using the messageManager to cause // a crash: addEventListener("DOMContentLoaded", () => { @@ -29,6 +33,10 @@ if ('nsICrashReporter' in Ci) { dumpID = subject.getPropertyAsAString('dumpID'); ok(dumpID, "dumpID is present and not an empty string"); + + // Let's check whether we have correctly reported OOM. + var isLikelyOOM = subject.getPropertyAsBool('isLikelyOOM'); + is(isLikelyOOM, crashType == 'CRASH_OOM', 'isLikelyOOM is correct'); } Services.obs.removeObserver(crashObserver, 'ipc:content-shutdown'); @@ -46,7 +54,7 @@ "Expected the right browsing context id on the oop-browser-crashed event."); }) - BrowserTestUtils.crashFrame(browser, true, false); + BrowserTestUtils.crashFrame(browser, true, false, /* Default browsing context */ null, { crashType }); Promise.all([observerPromise, eventPromise]).then(done); }); diff --git a/dom/ipc/tests/test_process_error_oom.xhtml b/dom/ipc/tests/test_process_error_oom.xhtml new file mode 100644 index 000000000000..dc7e0d3c85e9 --- /dev/null +++ b/dom/ipc/tests/test_process_error_oom.xhtml @@ -0,0 +1,22 @@ + + + + + + + + +