| <!-- webkit-test-runner [ UsesBackForwardCache=true ] --> |
| // 1. loads this page and it has a horizontal scrollbar |
| // 2. Navigates to a data URL and navigates back |
| var result = (innerHeight === document.documentElement.offsetHeight) |
| ? "FAIL: Scrollbar did not appear" |
| document.body.innerHTML = result; |
| function navigateAwayAndBack() |
| sessionStorage.horizontal_scroll_after_back_test_started = true; |
| document.getElementById('anchor').click(); |
| testRunner.waitUntilDone(); |
| setTimeout("navigateAwayAndBack()", 0); |
| function onVerifyPage(evt) |
| if (!sessionStorage.horizontal_scroll_after_back_test_started) |
| delete sessionStorage.horizontal_scroll_after_back_test_started; |
| // If pageshow is happening as result of navigation back then we proceed. |
| setTimeout("verifyPage()", 0); |
| document.body.innerHTML = "FAIL: Page did not go into the back/forward cache"; |
| onpageshow = onVerifyPage; |
| <body onload='runTestStep()'> |
| <div id="content"> <a id='anchor' href='../history/resources/page-cache-helper.html'>Where is the scrollbar?</a></div> |