OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 |
| 3 <script src="../../resources/js-test.js"></script> |
| 4 <script> |
| 5 description('Test that the window.onerror handler in resources/js-test.js ' + |
| 6 'stops asynchronous tests'); |
| 7 |
| 8 function errorThrower() |
| 9 { |
| 10 setTimeout(errorExpecter, 0); |
| 11 debug("Throwing an expected error"); |
| 12 throw new Error("An expected error"); |
| 13 } |
| 14 |
| 15 function errorExpecter() |
| 16 { |
| 17 shouldHaveHadError("expected error"); |
| 18 finishJSTest(); |
| 19 } |
| 20 |
| 21 window.jsTestIsAsync = true; |
| 22 debug("Will throw an error soon"); |
| 23 expectError(); |
| 24 setTimeout(errorThrower, 0); |
| 25 </script> |
| 26 |
OLD | NEW |