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 debug("Throwing an expected error"); |
| 11 throw new Error("An expected error"); |
| 12 } |
| 13 |
| 14 function errorExpecter() |
| 15 { |
| 16 shouldHaveHadError("expected error"); |
| 17 finishJSTest(); |
| 18 } |
| 19 |
| 20 window.jsTestIsAsync = true; |
| 21 debug("Will throw an error soon"); |
| 22 expectError(); |
| 23 setTimeout(errorThrower, 20); |
| 24 setTimeout(errorExpecter, 40); |
| 25 </script> |
| 26 |
OLD | NEW |