1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/content/html/document/test/test_bug482659.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,64 @@ 1.4 +<!DOCTYPE HTML> 1.5 +<html> 1.6 +<!-- 1.7 +https://bugzilla.mozilla.org/show_bug.cgi?id=482659 1.8 +--> 1.9 +<head> 1.10 + <title>Test for Bug 482659</title> 1.11 + <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> 1.12 + <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> 1.13 +</head> 1.14 +<body> 1.15 +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=482659">Mozilla Bug 482659</a> 1.16 +<p id="display"> 1.17 + <iframe></iframe> 1.18 + <iframe src="about:blank"></iframe> 1.19 + <iframe></iframe> 1.20 + <iframe src="about:blank"></iframe> 1.21 +</p> 1.22 +<div id="content" style="display: none"> 1.23 + 1.24 +</div> 1.25 +<pre id="test"> 1.26 +<script type="application/javascript"> 1.27 + 1.28 +/** Test for Bug 482659 **/ 1.29 +SimpleTest.waitForExplicitFinish() 1.30 + 1.31 +function testFrame(num) { 1.32 + is(window.frames[num].document.baseURI, document.baseURI, 1.33 + "Unexpected base URI in frame " + num); 1.34 + is(window.frames[num].document.documentURI, "about:blank", 1.35 + "Unexpected document URI in frame " + num); 1.36 +} 1.37 + 1.38 +function appendScript(doc) { 1.39 + var s = doc.createElement("script"); 1.40 + s.textContent = "document.write('executed'); document.close()"; 1.41 + doc.body.appendChild(s); 1.42 +} 1.43 + 1.44 +function verifyScriptRan(num) { 1.45 + is(window.frames[num].document.documentElement.textContent, "executed", 1.46 + "write didn't happen in frame " + num); 1.47 +} 1.48 + 1.49 +addLoadEvent(function() { 1.50 +/* document.write part of test disabled due to bug 483818 1.51 + appendScript(window.frames[2].document); 1.52 + appendScript(window.frames[3].document); 1.53 + 1.54 + verifyScriptRan(2); 1.55 + verifyScriptRan(3); 1.56 +*/ 1.57 + for (var i = 0; i < 4; ++i) { 1.58 + testFrame(i); 1.59 + } 1.60 + 1.61 + SimpleTest.finish(); 1.62 +}); 1.63 + 1.64 +</script> 1.65 +</pre> 1.66 +</body> 1.67 +</html>