| OLD | NEW |
| (Empty) |
| 1 <html> | |
| 2 <script> | |
| 3 var timeoutValue = 100; //ms | |
| 4 | |
| 5 var timestamp; | |
| 6 function verify() { | |
| 7 var actualTimerDelay = new Date().getTime() - timestamp; | |
| 8 document.getElementById("result").innerHTML = | |
| 9 actualTimerDelay >= timeoutValue ? 'PASS' : 'FAIL with ' + actualTimerDe
lay + ' ms delay.'; | |
| 10 | |
| 11 if (window.testRunner) | |
| 12 testRunner.notifyDone(); | |
| 13 } | |
| 14 | |
| 15 function runTest() { | |
| 16 if (window.testRunner) { | |
| 17 testRunner.dumpAsText(); | |
| 18 testRunner.waitUntilDone(); | |
| 19 testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1); | |
| 20 } | |
| 21 // Location changes need to happen outside the onload handler to generate hi
story entries. | |
| 22 setTimeout(function() { | |
| 23 window.setTimeout(verify, timeoutValue); | |
| 24 timestamp = new Date().getTime(); | |
| 25 window.location.href = "data:text/html,<body onload='history.back()'></bod
y>"; | |
| 26 }, 0); | |
| 27 } | |
| 28 | |
| 29 </script> | |
| 30 <body onload='runTest()'> | |
| 31 This test verifies that when page is loaded from the page cache on navigation ba
ck, the suspended timers are resumed for a duration left when they were suspende
d. This is a test for https://bugs.webkit.org/show_bug.cgi?id=28683.<br> | |
| 32 The test navigates to a page, starts a timer and then navigates to another page
and back. It then measures time when the timer is actually fired and makes sure
that it is at least the time set at the beginning. If successful, it outputs 'PA
SS' below. | |
| 33 <div id="result"></div> | |
| 34 </body> | |
| 35 </html> | |
| OLD | NEW |