test_bug649134.html (1548B)
1 <!DOCTYPE HTML> 2 <html> 3 <!-- 4 https://bugzilla.mozilla.org/show_bug.cgi?id=649134 5 --> 6 <head> 7 <title>Test for Bug 649134</title> 8 <script src="/tests/SimpleTest/SimpleTest.js"></script> 9 </head> 10 <body> 11 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=649134">Mozilla Bug 649134</a> 12 <div id="content" style="display: none"> 13 14 </div> 15 <pre id="test"> 16 <script type="application/javascript"> 17 18 /** Test for Bug 649134 */ 19 SimpleTest.waitForExplicitFinish(); 20 21 var calls = 0; 22 function finish() { 23 if (++calls == 4) 24 SimpleTest.finish(); 25 } 26 function verifyNoLoad(iframe) { 27 ok(iframe.contentDocument.body.offsetHeight > 0, 28 "HTTP Link stylesheet was ignored " + iframe.src); 29 finish(); 30 } 31 var verifyLoadCalls = 0; 32 function verifyLoad(iframe) { 33 if (++verifyLoadCalls == 2) { 34 ok(indexContent == iframe.contentDocument.body.innerHTML, 35 "bug649134/ loads bug649134/index.html " + iframe.src); 36 } 37 finish(); 38 } 39 function indexLoad(iframe) { 40 indexContent = iframe.contentDocument.body.innerHTML; 41 verifyLoad(iframe); 42 } 43 44 </script> 45 </pre> 46 <p id="display"> 47 <!-- Note: the extra sub-directory is needed for the test, see bug 649134 comment 14 --> 48 <iframe onload="verifyNoLoad(this);" src="bug649134/file_bug649134-1.sjs"></iframe> 49 <iframe onload="verifyNoLoad(this);" src="bug649134/file_bug649134-2.sjs"></iframe> 50 <iframe onload="verifyLoad(this);" src="bug649134/"></iframe> <!-- verify that mochitest server loads index.html --> 51 <iframe onload="indexLoad(this);" src="bug649134/index.html"></iframe> 52 </p> 53 </body> 54 </html>