blob: 383ee1162572e2f43321362cdae1694c963161ac [file] [log] [blame]
<!DOCTYPE html> <!-- webkit-test-runner [ useFlexibleViewport=true ] -->
<html>
<head>
<script src="../../../resources/ui-helper.js"></script>
<script src="../../../resources/js-test.js"></script>
<style>
html, body {
margin: 0;
width: 100%;
height: 100%;
}
input {
font-size: 320px;
display: block;
}
</style>
</head>
<body>
<input id="input" value="covfefe">
<script>
const input = document.getElementById("input");
jsTestIsAsync = true;
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.");
(async function() {
await UIHelper.activateAndWaitForInputSessionAt(100, 200);
input.addEventListener("click", () => {
setTimeout(() => {
shouldBe("input.selectionStart", "0");
shouldBe("input.selectionEnd", "7");
finishJSTest();
});
});
UIHelper.tapAt(800, 200);
})();
</script>
</body>
</html>