Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!DOCTYPE html> | |
| 2 <html> | |
| 3 <head> | |
| 4 <script src="../js/resources/js-test-pre.js"></script> | |
| 5 <script src="resources/onerror-test.js"></script> | |
| 6 <script> | |
| 7 var errorMessage, errorURL, errorLine, errorColumn; | |
| 8 window.onerror = function (message, url, line, column) { | |
| 9 errorMessage = message; | |
| 10 errorURL = url; | |
| 11 errorLine = line; | |
| 12 errorColumn = column; | |
| 13 | |
| 14 shouldBeEqualToString('window.event.type', 'error'); | |
| 15 shouldBe('errorMessage', 'window.event.message'); | |
| 16 shouldBe('stripURL(errorURL)', 'stripURL(window.event.filename)'); | |
| 17 shouldBe('errorLine', 'window.event.lineno'); | |
| 18 | |
| 19 // FIXME: Update this once the event interface has columns. | |
|
do-not-use
2013/07/24 13:18:01
Good idea.
| |
| 20 shouldBeUndefined('window.event.column'); | |
| 21 return true; | |
| 22 }; | |
| 23 </script> | |
| 24 </head> | |
| 25 <body> | |
| 26 <p>This tests that when 'window.onerror' handler is called, 'window.event' i s the corresponding ErrorEvent object.</p> | |
| 27 <script> | |
| 28 throwException(); | |
| 29 </script> | |
| 30 <script src="../js/resources/js-test-post.js"></script> | |
| 31 </body> | |
| 32 </html> | |
| OLD | NEW |