OLD | NEW |
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> | 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <script src="../../../resources/js-test.js"></script> | 4 <script src="../../../resources/js-test.js"></script> |
5 <script> | 5 <script> |
6 var jsTestIsAsync = true; | 6 var jsTestIsAsync = true; |
7 var newScriptElement; | 7 var newScriptElement; |
8 | 8 |
9 function start() | 9 function start() |
10 { | 10 { |
11 newScriptElement = document.createElement('script'); | 11 newScriptElement = document.createElement('script'); |
| 12 newScriptElement.async = false; |
12 document.body.appendChild(newScriptElement); | 13 document.body.appendChild(newScriptElement); |
13 newScriptElement.onerror = customOnError; | 14 newScriptElement.onerror = customOnError; |
14 newScriptElement.src = 'foobarbaz'; | 15 newScriptElement.src = 'foobarbaz'; |
15 } | 16 } |
16 | 17 |
17 function customOnError() | 18 function customOnError() |
18 { | 19 { |
19 document.body.removeChild(newScriptElement); | 20 document.body.removeChild(newScriptElement); |
20 var otherDocument = document.getElementById('frame').contentWindow.document; | 21 var otherDocument = document.getElementById('frame').contentWindow.document; |
21 otherDocument.documentElement.appendChild(newScriptElement); | 22 otherDocument.documentElement.appendChild(newScriptElement); |
22 finishJSTest(); | 23 finishJSTest(); |
23 } | 24 } |
24 </script> | 25 </script> |
25 </head> | 26 </head> |
26 <body onload="start()"> | 27 <body onload="start()"> |
27 Checks that we handle scripts which move to a different document inside their on
error handlers. | 28 Checks that we handle sync scripts which move to a different document inside the
ir onerror handlers. |
28 <div id="console"></div> | 29 <div id="console"></div> |
29 <iframe id="frame"></iframe> | 30 <iframe id="frame"></iframe> |
30 </body> | 31 </body> |
31 </html> | 32 </html> |
OLD | NEW |