Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(69)

Unified Diff: LayoutTests/fast/events/before-unload-returnValue.html

Issue 22893051: Add support for BeforeUnloadEvent (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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>
+

Powered by Google App Engine
This is Rietveld 408576698