[Release] Webkit-EFL Ver. 2.0_beta_118996_0.6.24
[framework/web/webkit-efl.git] / LayoutTests / fast / harness / use-page-cache.html
1 <html>
2 <script>
3 window.finish = function()
4 {
5     if (layoutTestController)
6         layoutTestController.notifyDone();
7 }
8
9 window.log = function(message) {
10      document.getElementById("result").innerHTML += message + "<br>";
11 }
12
13 window.failure = function(message) {
14     log("FAIL: " + message);
15     finish();
16 }
17
18 var onloadReportCount = 0;
19 window.reportOnload = function() {
20     if (++onloadReportCount > 1)
21         failure("Multiple onload calls on page-1.");
22 }
23
24 function test()
25 {
26     if (window.layoutTestController) {
27         layoutTestController.dumpAsText();
28         layoutTestController.waitUntilDone();
29         layoutTestController.setCanOpenWindows();
30         layoutTestController.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
31     }
32     log("open page-1");
33     window.open("resources/cached-page-1.html");
34 }
35 </script>
36
37 <body onload="test()">
38 <p>This test uses layoutTestController.overridePreference("WebKitUsesPageCachePreferenceKey", 1); to enable
39 back-forward WebKit page cache for the duration of the test.
40 The test enables cache, navigates to page-1, then to page-2 and then does history.back() to page-1.
41 On navigation back to page-1, test verifies that previously-initialized timer continues to fire and
42 onload is not called again.
43 If test fails it hangs or outputs 'FAIL' below.
44 <div id="result"></div>
45 </body>
46 </html>