Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- Manifest: js/xpconnect/tests/chrome/chrome.toml
<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="chrome://global/skin"?>
<?xml-stylesheet type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"?>
<!--
-->
<window title="Mozilla Bug 799348"
<script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
<!-- test results are displayed in the html:body -->
<body xmlns="http://www.w3.org/1999/xhtml">
target="_blank">Mozilla Bug 799348</a>
</body>
<!-- test code goes here -->
<script type="application/javascript">
<![CDATA[
/** Test for Bug 799348 */
SimpleTest.waitForExplicitFinish();
var gCalledOnload = false;
var myObserver = {
QueryInterface: ChromeUtils.generateQI(["nsIObserver"]),
observe(win, topic) {
if (topic == "domwindowopened") {
ok(!gCalledOnload, "domwindowopened notification fired before onload");
win.addEventListener("load", function() {
gCalledOnload = true;
win.close();
});
} else if (topic == "domwindowclosed") {
ok(gCalledOnload, "should have called onload");
Services.ww.unregisterNotification(myObserver);
SimpleTest.finish();
} else {
ok(false, "unknown topic");
}
}
};
Services.ww.registerNotification(myObserver);
]]>
</script>
<iframe id="frame" type="content" src="http://test1.example.org/tests/js/xpconnect/tests/mochitest/file_bug799348.html" />
</window>