gecko-dev/dom/ipc/tests/process_error.xul

38 строки
1.3 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[
ChromeUtils.import("resource://gre/modules/Services.jsm");
ChromeUtils.import("resource://testing-common/BrowserTestUtils.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 Ci.nsIPropertyBag2,
'Subject implements nsIPropertyBag2.');
var dumpID;
if ('nsICrashReporter' in Ci) {
dumpID = subject.getPropertyAsAString('dumpID');
ok(dumpID, "dumpID is present and not an empty string");
}
Services.obs.removeObserver(crashObserver, 'ipc:content-shutdown');
done();
}
Services.obs.addObserver(crashObserver, 'ipc:content-shutdown');
BrowserTestUtils.crashBrowser(document.getElementById('thebrowser'), true, false);
]]></script>
</window>