Loading dom/ipc/tests/chrome.ini +4 −0 Original line number Diff line number Diff line Loading @@ -5,3 +5,7 @@ support-files = [test_process_error.xhtml] skip-if = !crashreporter [test_process_error_oom.xhtml] skip-if = !crashreporter dom/ipc/tests/process_error.xhtml +9 −1 Original line number Diff line number Diff line Loading @@ -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", () => { Loading @@ -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'); Loading @@ -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); }); Loading dom/ipc/tests/test_process_error_oom.xhtml 0 → 100644 +22 −0 Original line number Diff line number Diff line <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?> <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" /> <script> SimpleTest.waitForExplicitFinish(); SimpleTest.expectChildProcessCrash(); var w = window.docShell.rootTreeItem.domWindow.openDialog('process_error.xhtml?crashType=CRASH_OOM', '_blank', 'chrome,resizable=yes,width=400,height=600', window); function done() { w.close(); SimpleTest.finish(); } </script> <body xmlns="http://www.w3.org/1999/xhtml" style="height: 300px; overflow: auto;" /> </window> Loading
dom/ipc/tests/chrome.ini +4 −0 Original line number Diff line number Diff line Loading @@ -5,3 +5,7 @@ support-files = [test_process_error.xhtml] skip-if = !crashreporter [test_process_error_oom.xhtml] skip-if = !crashreporter
dom/ipc/tests/process_error.xhtml +9 −1 Original line number Diff line number Diff line Loading @@ -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", () => { Loading @@ -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'); Loading @@ -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); }); Loading
dom/ipc/tests/test_process_error_oom.xhtml 0 → 100644 +22 −0 Original line number Diff line number Diff line <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?> <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" /> <script> SimpleTest.waitForExplicitFinish(); SimpleTest.expectChildProcessCrash(); var w = window.docShell.rootTreeItem.domWindow.openDialog('process_error.xhtml?crashType=CRASH_OOM', '_blank', 'chrome,resizable=yes,width=400,height=600', window); function done() { w.close(); SimpleTest.finish(); } </script> <body xmlns="http://www.w3.org/1999/xhtml" style="height: 300px; overflow: auto;" /> </window>