| <!DOCTYPE html> <!-- webkit-test-runner [ useFlexibleViewport=true ] --> |
| <script src="../../../resources/ui-helper.js"></script> |
| <script src="../../../resources/js-test.js"></script> |
| <input id="input" value="covfefe"> |
| const input = document.getElementById("input"); |
| selectionChanged = false; |
| description("This test verifies that tapping in a misspelled word selects the misspelled word, and does not cause " + |
| "the selection to collapse after a click event is dispatched. To manually test, tap the input field to bring up " + |
| "the keyboard, and then tap on a part of the word in the input field that is far away from the editing caret. As " + |
| "a result, the contents of the input should be selected and marked as a misspelled word."); |
| await UIHelper.activateAndWaitForInputSessionAt(100, 200); |
| input.addEventListener("click", () => clicked = true); |
| document.addEventListener("selectionchange", () => selectionChanged = true); |
| await UIHelper.tapAt(300, 200); |
| shouldBecomeEqual("clicked && selectionChanged", "true", () => { |
| shouldBe("input.selectionStart", "0"); |
| shouldBe("input.selectionEnd", "7"); |