| <meta name="viewport" content="width=device-width"> |
| <p>Test that the keyboard disappears when the focused element is removed.<br> |
| To manually test, focus the text field below and type any character on iOS. The keyboard should be dismissed.</p> |
| <input oninput="this.remove();"> |
| if (window.testRunner && testRunner.runUIScript) { |
| testRunner.waitUntilDone(); |
| var input = document.querySelector('input'); |
| const x = input.offsetLeft + 5; |
| const y = input.offsetTop + 5; |
| uiController.didShowKeyboardCallback = function() { uiController.uiScriptComplete(); } |
| uiController.singleTapAtPoint(${x}, ${y}, function() {});`, |
| function endTest(result) { |
| document.getElementById('result').textContent = result; |
| setTimeout(endTest.bind(this, 'FAIL'), 5000); |
| uiController.didHideKeyboardCallback = function() { uiController.uiScriptComplete(); } |
| uiController.typeCharacterUsingHardwareKeyboard('a', function () { });`, |
| endTest.bind(this, 'PASS')); |