OLD | NEW |
1 <html> | 1 <html> |
2 | 2 |
3 <head> | 3 <head> |
4 <script> | 4 <script> |
5 | 5 |
6 if (window.testRunner) { | 6 if (window.testRunner) { |
7 testRunner.dumpAsText(); | 7 testRunner.dumpAsText(); |
8 testRunner.waitUntilDone(); | 8 testRunner.waitUntilDone(); |
9 } | 9 } |
10 | 10 |
11 window.addEventListener('beforeunload', before, false); | 11 window.addEventListener('beforeunload', before, false); |
12 window.onunload = unload; | 12 window.onunload = unload; |
13 | 13 |
14 function before() | 14 function before() |
15 { | 15 { |
16 alert( "before unload"); | 16 alert( "before unload"); |
17 } | 17 } |
18 | 18 |
19 function unload() | 19 function unload() |
20 { | 20 { |
21 alert( "unload" ); | 21 alert( "unload" ); |
22 window.removeEventListener('beforeunload', before, false); | 22 window.removeEventListener('beforeunload', before, false); |
23 } | 23 } |
24 | 24 |
25 function load() | 25 function load() |
26 { | 26 { |
27 location = "data:text/html,If you didn't hit an assert you PASS.<script>if (
window.testRunner) testRunner.notifyDone(); </" + "script>"; | 27 location = "resources/onunload-clears-onbeforeunload-success.html"; |
28 } | 28 } |
29 | 29 |
30 </script> | 30 </script> |
31 </head> | 31 </head> |
32 | 32 |
33 <body onload="load()"> | 33 <body onload="load()"> |
34 start document | 34 start document |
35 </body> | 35 </body> |
36 | 36 |
37 </html> | 37 </html> |
OLD | NEW |