Add a script to run ImageDiff manually
[WebKit-https.git] / LayoutTests / fast / events / pageshow-pagehide-on-back-cached.html
1 <p>Test pageshow/pagehide event behavior when navigating back to an cached page.</p>
2 <script>
3 if (window.testRunner) {
4     testRunner.dumpAsText();
5     testRunner.waitUntilDone();
6       testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
7 }
8
9 window.onload = function(evt) {
10     alert("window.onload");
11 }
12
13 window.onpageshow = function(evt) {
14     alert("window.onpageshow" + ", target = " + evt.target + ", persisted = " + evt.persisted);
15     if (evt.persisted) {
16         // Returned back.
17         window.onpagehide = null;
18         setTimeout(function() { if (window.testRunner) testRunner.notifyDone(); }, 0);
19     } else {
20         setTimeout('window.location.href = "data:text/html,<script>history.back();</scr" + "ipt>"', 0);
21     }
22 }
23
24 window.onpagehide = function(evt) {
25     alert("window.onpagehide" + ", target = " + evt.target + ", persisted = " + evt.persisted);
26 }
27
28 </script>