| OLD | NEW |
| 1 <!DOCTYPE HTML> | 1 <!DOCTYPE HTML> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 </head> | 4 </head> |
| 5 <body> | 5 <body> |
| 6 <p>Test that window.onerror and "error" event listeners from isolated world are | 6 <p>Test that window.onerror and "error" event listeners from isolated world are |
| 7 invoked for uncaught exceptions in user scripts running in isolate worlds as | 7 invoked for uncaught exceptions in scripts running in isolate worlds as |
| 8 well as for exceptions in the main world.<a href="https://bugs.webkit.org/show_b
ug.cgi?id=8519">Bug 8519.</a> | 8 well as for exceptions in the main world.<a href="https://bugs.webkit.org/show_b
ug.cgi?id=8519">Bug 8519.</a> |
| 9 </p> | 9 </p> |
| 10 <div id="console"></div> | 10 <div id="console"></div> |
| 11 <script> | 11 <script> |
| 12 | 12 |
| 13 var expectedRecordCount = 10; | 13 var expectedRecordCount = 10; |
| 14 var recordCount = 0; | 14 var recordCount = 0; |
| 15 document.getElementById("console").addEventListener("DOMNodeInserted", function(
e) { | 15 document.getElementById("console").addEventListener("DOMNodeInserted", function(
e) { |
| 16 if (++recordCount === expectedRecordCount && window.testRunner) | 16 if (++recordCount === expectedRecordCount && window.testRunner) |
| 17 testRunner.notifyDone(); | 17 testRunner.notifyDone(); |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 window.addEventListener("error", function(e) { | 50 window.addEventListener("error", function(e) { |
| 51 var url = lastUrlComponent(e.filename); | 51 var url = lastUrlComponent(e.filename); |
| 52 log(isolatedWorld + " error event listener: " + e.message + " at " + url
+ ":" + e.lineno, "*"); | 52 log(isolatedWorld + " error event listener: " + e.message + " at " + url
+ ":" + e.lineno, "*"); |
| 53 e.preventDefault(); | 53 e.preventDefault(); |
| 54 }, false); | 54 }, false); |
| 55 }; | 55 }; |
| 56 | 56 |
| 57 if (window.testRunner) { | 57 if (window.testRunner) { |
| 58 testRunner.dumpAsText(); | 58 testRunner.dumpAsText(); |
| 59 testRunner.waitUntilDone(); | 59 testRunner.waitUntilDone(); |
| 60 testRunner.addUserScript("(" + errorHandlers + ")('user script'); (" + throw
Exceptions + ")('user script')", false, true); | 60 testRunner.evaluateScriptInIsolatedWorld(1, "(" + errorHandlers + ")('isolat
ed world'); (" + throwExceptions + ")('isolated world')"); |
| 61 } | 61 } |
| 62 | 62 |
| 63 throwExceptions("main world"); | 63 throwExceptions("main world"); |
| 64 | 64 |
| 65 </script> | 65 </script> |
| 66 </body> | 66 </body> |
| 67 </html> | 67 </html> |
| OLD | NEW |