2010-11-24 05:58:21 -08:00
|
|
|
<?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;
|
|
|
|
|
2011-06-08 15:49:17 -07:00
|
|
|
function getMinidumpDirectory() {
|
|
|
|
var dir = Services.dirsvc.get('ProfD', Components.interfaces.nsIFile);
|
|
|
|
dir.append("minidumps");
|
|
|
|
return dir;
|
|
|
|
}
|
|
|
|
|
|
|
|
function removeFile(directory, filename) {
|
|
|
|
var file = directory.clone();
|
|
|
|
file.append(filename);
|
|
|
|
if (file.exists()) {
|
|
|
|
file.remove(false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-11-24 05:58:21 -08:00
|
|
|
function crashObserver(subject, topic, data) {
|
|
|
|
is(topic, 'ipc:content-shutdown', 'Received correct observer topic.');
|
|
|
|
ok(subject instanceof Components.interfaces.nsIPropertyBag2,
|
|
|
|
'Subject implements nsIPropertyBag2.');
|
2011-06-08 15:49:17 -07:00
|
|
|
|
|
|
|
var dumpID;
|
2010-11-24 05:58:21 -08:00
|
|
|
if ('nsICrashReporter' in Components.interfaces) {
|
2011-06-08 15:49:17 -07:00
|
|
|
dumpID = subject.getPropertyAsAString('dumpID');
|
|
|
|
ok(dumpID, "dumpID is present and not an empty string");
|
|
|
|
}
|
|
|
|
|
|
|
|
if (dumpID) {
|
|
|
|
var minidumpDirectory = getMinidumpDirectory();
|
|
|
|
removeFile(minidumpDirectory, dumpID + '.dmp');
|
|
|
|
removeFile(minidumpDirectory, dumpID + '.extra');
|
2010-11-24 05:58:21 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
Services.obs.removeObserver(crashObserver, 'ipc:content-shutdown');
|
|
|
|
done();
|
|
|
|
}
|
|
|
|
Services.obs.addObserver(crashObserver, 'ipc:content-shutdown', false);
|
|
|
|
|
2012-08-27 07:13:02 -07:00
|
|
|
document.getElementById('thebrowser')
|
|
|
|
.QueryInterface(Components.interfaces.nsIFrameLoaderOwner)
|
|
|
|
.frameLoader.messageManager
|
|
|
|
.loadFrameScript('chrome://mochitests/content/chrome/dom/ipc/tests/process_error_contentscript.js', true);
|
2010-11-24 05:58:21 -08:00
|
|
|
]]></script>
|
|
|
|
|
|
|
|
</window>
|