| <script src="../../resources/basic-gestures.js"></script> |
| <script src="../../resources/ui-helper.js"></script> |
| testRunner.waitUntilDone(); |
| if (!testRunner.runUIScript) |
| await UIHelper.setHardwareKeyboardAttached(false); |
| await UIHelper.activateElementAndWaitForInputSession(document.getElementById('editable')); |
| var programmaticScroll = 500; |
| document.scrollingElement.scrollTop = programmaticScroll; |
| await UIHelper.enterText("Test"); |
| await UIHelper.ensurePresentationUpdate(); |
| if (window.pageYOffset < programmaticScroll) |
| output += 'PASS: page has scrolled back to the top to show the element that has text being entered into it.'; |
| output += 'FAIL: page has failed to scroll when entering text into a form that is offscreen.'; |
| document.getElementById('testArea').innerHTML = output; |
| window.addEventListener('load', runTest, false); |
| background-color: silver; |
| This test focuses a form, them scrolls to the bottom of the page. |
| Then text is entered in the form, and we check to make sure the page has scrolled |
| so that the input is visible again. |
| <div id="testArea"><input id="editable" type="text"></input></div> |