Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / fast / events / before-unload-return-value-from-listener.html
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../../resources/js-test.js"></script>
5 <script>
6 if (window.testRunner)
7     testRunner.setShouldStayOnPageAfterHandlingBeforeUnload(true);
8
9 var testEvent;
10 window.onload = function() {
11     window.location.href = "resources/does-not-exist.html";
12     setTimeout(function() {
13         shouldBeEqualToString("testEvent.returnValue", "");
14         finishJSTest();
15     }, 0);
16 }
17
18 window.addEventListener('beforeunload', function(event) {
19     testEvent = event;
20     shouldBe("testEvent.__proto__", "BeforeUnloadEvent.prototype");
21     return "not supposed to be assigned to returnValue";
22 }, false);
23 </script>
24 </head>
25 <body>
26 <script>
27 description("Tests the returnValue attribute of the BeforeUnloadEvent from an event listener.");
28 self.jsTestIsAsync = true;
29 </script>
30 </body>
31 </html>
32