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

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: Fix test failures 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
« no previous file with comments | « no previous file | LayoutTests/fast/events/before-unload-returnValue-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..01132ec4cdd756138e5886d0a341cf5e6411f622
--- /dev/null
+++ b/LayoutTests/fast/events/before-unload-returnValue.html
@@ -0,0 +1,32 @@
+<!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>
+</head>
+<body>
+<script>
+description("Tests the returnValue attribute of the BeforeUnloadEvent.");
+self.jsTestIsAsync = true;
+</script>
+<script src="../js/resources/js-test-post.js"></script>
+</body>
+</html>
+
« no previous file with comments | « no previous file | LayoutTests/fast/events/before-unload-returnValue-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698