| OLD | NEW |
| (Empty) |
| 1 <html> | |
| 2 <script> | |
| 3 window.finish = function() | |
| 4 { | |
| 5 if (testRunner) | |
| 6 testRunner.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.testRunner) { | |
| 27 testRunner.dumpAsText(); | |
| 28 testRunner.waitUntilDone(); | |
| 29 testRunner.setCanOpenWindows(); | |
| 30 testRunner.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 testRunner.overridePreference("WebKitUsesPageCachePreferenceKe
y", 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 histor
y.back() to page-1. | |
| 41 On navigation back to page-1, test verifies that previously-initialized timer co
ntinues 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> | |
| OLD | NEW |