Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test gets skipped with pattern: os == 'android'
- Manifest: js/xpconnect/tests/chrome/chrome.toml
<?xml version="1.0"?>
<!--
-->
<!-- test results are displayed in the html:body -->
</body>
<!-- test code goes here -->
<script type="application/javascript">
<![CDATA[
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>