Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- Manifest: dom/html/test/mochitest.toml
<!DOCTYPE HTML>
<html>
<!--
-->
<head>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=482659">Mozilla Bug 482659</a>
<p id="display">
<iframe></iframe>
<iframe src="about:blank"></iframe>
<iframe></iframe>
<iframe src="about:blank"></iframe>
</p>
<div id="content" style="display: none">
</div>
<pre id="test">
<script type="application/javascript">
SimpleTest.waitForExplicitFinish()
function testFrame(num) {
is(window.frames[num].document.baseURI, document.baseURI,
"Unexpected base URI in frame " + num);
is(window.frames[num].document.documentURI, "about:blank",
"Unexpected document URI in frame " + num);
}
function appendScript(doc) {
var s = doc.createElement("script");
s.textContent = "document.write('executed'); document.close()";
doc.body.appendChild(s);
}
function verifyScriptRan(num) {
is(window.frames[num].document.documentElement.textContent, "executed",
"write didn't happen in frame " + num);
}
addLoadEvent(function() {
appendScript(window.frames[2].document);
appendScript(window.frames[3].document);
verifyScriptRan(2);
verifyScriptRan(3);
*/
for (var i = 0; i < 4; ++i) {
testFrame(i);
}
SimpleTest.finish();
});
</script>
</pre>
</body>
</html>