3 window.finish = function()
5 if (layoutTestController)
6 layoutTestController.notifyDone();
9 window.log = function(message) {
10 document.getElementById("result").innerHTML += message + "<br>";
13 window.failure = function(message) {
14 log("FAIL: " + message);
18 var onloadReportCount = 0;
19 window.reportOnload = function() {
20 if (++onloadReportCount > 1)
21 failure("Multiple onload calls on page-1.");
26 if (window.layoutTestController) {
27 layoutTestController.dumpAsText();
28 layoutTestController.waitUntilDone();
29 layoutTestController.setCanOpenWindows();
30 layoutTestController.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
33 window.open("resources/cached-page-1.html");
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>