Source code
Revision control
Copy as Markdown
Other Tools
<?xml version="1.0"?>
<!--
-->
onload="setTimeout(run, 0);">
<!-- test code goes here -->
<script type="application/javascript">
<![CDATA[
var testcontent = null;
function run() {
testcontent = document.getElementById("testcontent");
shouldHaveTwoNonHiddenDocumentViewers();
testcontent.setAttribute("src", "foobarpage");
setTimeout(errorPageLoaded, 2500)
}
function errorPageLoaded() {
testcontent.addEventListener("pageshow", didGoBack, true);
setTimeout(function() {testcontent.contentWindow.history.back();}, 0);
}
function didGoBack(e) {
testcontent.removeEventListener("pageshow", didGoBack, true);
shouldHaveTwoNonHiddenDocumentViewers();
window.arguments[0].done();
window.close();
}
function getDocumentViewer(win) {
return win.docShell.docViewer;
}
function shouldHaveTwoNonHiddenDocumentViewers() {
window.arguments[0].is(getDocumentViewer(testcontent.contentWindow).isHidden, false, "Top level DocumentViewer should not be hidden.");
window.arguments[0].is(getDocumentViewer(testcontent.contentWindow.frames[0]).isHidden, false, " Iframe's DocumentViewer should not be hidden.");
}
]]>
</script>
<browser type="content" id="testcontent" flex="1" src="data:text/html,<iframe></iframe>"/>
</window>