mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-25 03:05:34 +00:00
3148018ed7
This patch removes the C++ code used to run the minidump analyzer when a content process crashes, and replaces it with JS code within the CrashService object. This removes the need for a separate shutdown blocker in C++ code and allows end-to-end testing of the crash service functionality. Additionally the exception handler code can be simplified since it's now only used to run the crash reporter client. The test added to test_crash_service.js covers computing the minidump SHA256 hash (bug 1322611) and of the minidump analyzer itself (bug 1280477). MozReview-Commit-ID: LO5w839NHev
42 lines
1.6 KiB
XML
42 lines
1.6 KiB
XML
<?xml version="1.0"?>
|
|
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
|
|
|
|
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
|
orient="vertical">
|
|
|
|
<browser id="thebrowser" type="content" remote="true" />
|
|
<script type="application/javascript"><![CDATA[
|
|
Components.utils.import("resource://gre/modules/Services.jsm");
|
|
|
|
const ok = window.opener.wrappedJSObject.ok;
|
|
const is = window.opener.wrappedJSObject.is;
|
|
const done = window.opener.wrappedJSObject.done;
|
|
const SimpleTest = window.opener.wrappedJSObject.SimpleTest;
|
|
|
|
function crashObserver(subject, topic, data) {
|
|
is(topic, 'ipc:content-shutdown', 'Received correct observer topic.');
|
|
ok(subject instanceof Components.interfaces.nsIPropertyBag2,
|
|
'Subject implements nsIPropertyBag2.');
|
|
|
|
var waitCrash = Promise.resolve();
|
|
var dumpID;
|
|
if ('nsICrashReporter' in Components.interfaces) {
|
|
dumpID = subject.getPropertyAsAString('dumpID');
|
|
ok(dumpID, "dumpID is present and not an empty string");
|
|
waitCrash = Services.crashmanager.ensureCrashIsPresent(dumpID);
|
|
}
|
|
|
|
Services.obs.removeObserver(crashObserver, 'ipc:content-shutdown');
|
|
waitCrash.then(done);
|
|
}
|
|
|
|
Services.obs.addObserver(crashObserver, 'ipc:content-shutdown');
|
|
|
|
document.getElementById('thebrowser')
|
|
.QueryInterface(Components.interfaces.nsIFrameLoaderOwner)
|
|
.frameLoader.messageManager
|
|
.loadFrameScript('chrome://mochitests/content/chrome/dom/ipc/tests/process_error_contentscript.js', true);
|
|
]]></script>
|
|
|
|
</window>
|