OLD | NEW |
1 <div id="console"></div> | 1 <div id="console"></div> |
2 <script> | 2 <script> |
3 if (window.testRunner) { | 3 if (window.testRunner) { |
4 testRunner.dumpAsText(); | 4 testRunner.dumpAsText(); |
5 testRunner.dumpResourceResponseMIMETypes(); | 5 testRunner.dumpResourceResponseMIMETypes(); |
6 } | 6 } |
7 | 7 |
8 function fail(str) { | 8 function fail(str) { |
9 var element = document.createElement("p"); | 9 var element = document.createElement("p"); |
10 element.innerHTML = str; | 10 element.innerHTML = str; |
11 document.getElementById("console").appendChild(element); | 11 document.getElementById("console").appendChild(element); |
12 } | 12 } |
13 | 13 |
14 var bogus_script = document.createElement("script"); | 14 var bogus_script = document.createElement("script"); |
15 bogus_script.type = "bogus"; | 15 bogus_script.type = "bogus"; |
16 bogus_script.src = "shouldnotexecute.js"; | 16 bogus_script.src = "shouldnotexecute.js"; |
17 bogus_script.addEventListener("beforeload", function() { fail('beforeload call
ed on dynamic script that won\'t be loaded'); }, false); | |
18 document.getElementsByTagName("head")[0].appendChild(bogus_script); | 17 document.getElementsByTagName("head")[0].appendChild(bogus_script); |
19 </script> | 18 </script> |
20 <script type="fake" src="shouldnotexecute.js"></script> | 19 <script type="fake" src="shouldnotexecute.js"></script> |
21 <script type="dummy" src="shouldnotexecute.js" onbeforeload="fail('beforeload ca
lled on parser inserted script that won\'t be loaded');"></script> | |
22 Unknown script types should not be loaded nor executed. If this test fails, an e
xtra line will appear in the output with the script's MIME type. | 20 Unknown script types should not be loaded nor executed. If this test fails, an e
xtra line will appear in the output with the script's MIME type. |
OLD | NEW |