Chromium Code Reviews| Index: LayoutTests/fast/events/before-unload-returnValue.html |
| diff --git a/LayoutTests/fast/events/before-unload-returnValue.html b/LayoutTests/fast/events/before-unload-returnValue.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..f1448f9685c5a4bada279d2c4f8b7d1b494af962 |
| --- /dev/null |
| +++ b/LayoutTests/fast/events/before-unload-returnValue.html |
| @@ -0,0 +1,31 @@ |
| +<!DOCTYPE html> |
| +<html> |
| +<head> |
| +<script src="../js/resources/js-test-pre.js"></script> |
| +<script> |
| +if (window.testRunner) |
| + testRunner.setShouldStayOnPageAfterHandlingBeforeUnload(true); |
| + |
| +window.onload = function() { |
| + window.location.href = "resources/does-not-exist.html"; |
| + setTimeout(finishJSTest, 0); |
| +} |
| + |
| +var testEvent; |
| +window.onbeforeunload = function(event) { |
| + testEvent = event; |
| + shouldBe("testEvent.__proto__", "BeforeUnloadEvent.prototype"); |
| + shouldBeEqualToString("testEvent.returnValue", ""); |
| + event.returnValue = "This is beforeunload from the top level frame."; |
| + shouldBeEqualToString("testEvent.returnValue", "This is beforeunload from the top level frame."); |
| +} |
| +</script> |
| +<body> |
|
haraken
2013/08/23 12:27:00
Nit: </head> is missing.
do-not-use
2013/08/23 14:27:54
Done.
|
| +<script> |
| +description("Tests the returnValue attribute of the BeforeUnloadEvent."); |
| +self.jsTestIsAsync = true; |
| +</script> |
| +<script src="../js/resources/js-test-post.js"></script> |
| +</body> |
| +</html> |
| + |