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); | |
| 12 } | |
| 13 | |
| 14 var testEvent; | |
| 15 window.onbeforeunload = function(event) { | |
| 16 testEvent = event; | |
| 17 shouldBe("testEvent.__proto__", "BeforeUnloadEvent.prototype"); | |
| 18 shouldBeEqualToString("testEvent.returnValue", ""); | |
| 19 event.returnValue = "This is beforeunload from the top level frame."; | |
| 20 shouldBeEqualToString("testEvent.returnValue", "This is beforeunload from th e top level frame."); | |
| 21 } | |
| 22 </script> | |
| 23 <body> | |
| 
 
haraken
2013/08/23 12:27:00
Nit: </head> is missing.
 
do-not-use
2013/08/23 14:27:54
Done.
 
 | |
| 24 <script> | |
| 25 description("Tests the returnValue attribute of the BeforeUnloadEvent."); | |
| 26 self.jsTestIsAsync = true; | |
| 27 </script> | |
| 28 <script src="../js/resources/js-test-post.js"></script> | |
| 29 </body> | |
| 30 </html> | |
| 31 | |
| OLD | NEW |