1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/content/base/test/test_bug371576-5.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,36 @@ 1.4 +<!DOCTYPE HTML> 1.5 +<html> 1.6 +<!-- 1.7 +https://bugzilla.mozilla.org/show_bug.cgi?id=371576 1.8 +--> 1.9 +<head id="head"> 1.10 + <title>Test for Bug 371576</title> 1.11 + <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> 1.12 + <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> 1.13 + 1.14 +<script> 1.15 +SimpleTest.waitForExplicitFinish(); 1.16 + 1.17 +addLoadEvent( 1.18 + function doe(){ 1.19 + var x=document.createElement('script'); 1.20 + x.src='data:text/html,var scr=document.createElement("script");\ 1.21 + scr.innerHTML = "function doe3(){$(\'display\').innerHTML = \'You should see this text\';}";\ 1.22 + $("head").appendChild(scr);'; 1.23 + x.onload= function (){ 1.24 + doe3(); 1.25 + ok(true,"function doe3 is defined, and the body content has been replaced."); 1.26 + is($("display").textContent, "You should see this text", "text set properly"); 1.27 + SimpleTest.finish(); 1.28 + }; 1.29 + $('head').appendChild(x); 1.30 + } 1.31 +); 1.32 +</script> 1.33 + 1.34 +</head> 1.35 +<body> 1.36 +<p id="display">You shouldn't see this</p> 1.37 +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=371576">Mozilla Bug 371576</a> 1.38 +</body> 1.39 +</html>