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> | |
| 6 if (window.testRunner) | |
| 7 testRunner.setShouldStayOnPageAfterHandlingBeforeUnload(true); | |
| 8 | |
| 9 window.onload = function() { | |
| 10 window.location.href = "resources/does-not-exist.html"; | |
| 11 setTimeout(finishJSTest, 0); | |
|
arv (Not doing code reviews)
2013/09/11 13:42:19
Why is this needed? window.onerror calls finishJST
do-not-use
2013/09/11 14:12:29
I had it in case it did not throw, to avoid a time
| |
| 12 } | |
|
arv (Not doing code reviews)
2013/09/11 13:42:19
semicolons after assignment.
| |
| 13 | |
| 14 var nonConvertibleToString = {toString: function() { throw "Exception in toStrin g()"; }}; | |
| 15 | |
| 16 var testMessage; | |
| 17 window.onerror = function(msg) { | |
| 18 testMessage = msg; | |
| 19 shouldBeEqualToString("testMessage", "Uncaught Exception in toString()"); | |
| 20 setTimeout(finishJSTest, 0); | |
|
do-not-use
2013/09/11 09:00:43
I am not quite sure why this setTimeout() is neede
haraken
2013/09/11 09:08:44
Looks strange. arv, do you have any idea?
arv (Not doing code reviews)
2013/09/11 13:42:19
I'm not sure. Maybe it is related to setShouldStay
| |
| 21 return true; | |
| 22 } | |
| 23 | |
| 24 window.onbeforeunload = function(event) { | |
| 25 return nonConvertibleToString; | |
| 26 } | |
| 27 </script> | |
| 28 </head> | |
| 29 <body> | |
| 30 <script> | |
| 31 description("Tests that an exception is thrown when the value returned in the be foreunload callback cannot be converted to a String"); | |
| 32 window.jsTestIsAsync = true; | |
|
arv (Not doing code reviews)
2013/09/11 13:42:19
move this to other script block, before if window.
| |
| 33 </script> | |
| 34 <script src="../js/resources/js-test-post.js"></script> | |
| 35 </body> | |
| 36 </html> | |
| 37 | |
| OLD | NEW |