OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 <head> |
| 4 <script> |
| 5 window.jsTestIsAsync = true; |
| 6 window.isOnErrorTest = true; |
| 7 </script> |
| 8 <script src="../js/resources/js-test-pre.js"></script> |
| 9 <script src="resources/onerror-test.js"></script> |
| 10 </head> |
| 11 <body> |
| 12 <script> |
| 13 description('Test that window.onerror and "error" event listeners from m
ain world are invoked for uncaught exceptions in scripts running in isolate worl
ds as well as for exceptions in the main world.'); |
| 14 |
| 15 function callback(errorsHandled) { |
| 16 if (errorsHandled === 12) |
| 17 finishJSTest(); |
| 18 } |
| 19 |
| 20 dumpOnErrorArgumentValuesAndReturn(true, callback); |
| 21 dumpErrorEventAndPreventDefault(callback); |
| 22 |
| 23 var exceptions = function(worldType) |
| 24 { |
| 25 window.addEventListener("load", function(e) { |
| 26 // Do the following call from load listener to make sure error i
n the setTimeout callback always happens after the error in this listener. |
| 27 setTimeout(function() { |
| 28 throw new Error("Error in " + worldType + " world setTimeout
callback."); |
| 29 }, 0); |
| 30 throw new Error("Error in " + worldType + " world load handler."
); |
| 31 }, false); |
| 32 |
| 33 throw new Error("Error in " + worldType + " world inline script."); |
| 34 } |
| 35 |
| 36 if (window.testRunner) |
| 37 testRunner.evaluateScriptInIsolatedWorld(1, "(" + exceptions + ")('i
solated')"); |
| 38 |
| 39 exceptions("main"); |
| 40 |
| 41 </script> |
| 42 <script src="../js/resources/js-test-post.js"></script> |
| 43 </body> |
| 44 </html> |
OLD | NEW |