blob: bfcf9f2b2f8b2a389cb697bb2a65f47ad70f5ee7 [file] [log] [blame]
<!DOCTYPE html> <!-- webkit-test-runner [ useFlexibleViewport=true ] -->
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<script src="../../../resources/ui-helper.js"></script>
<script>
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
}
async function runTest()
{
if (!window.testRunner || !testRunner.runUIScript)
return;
var inputEl = document.getElementById("editable");
await UIHelper.activateElementAndWaitForInputSession(inputEl);
window.getSelection().setBaseAndExtent(inputEl, 0, inputEl, 2);
await UIHelper.applyAutocorrection("To", "Ti");
testRunner.notifyDone();
}
window.addEventListener('load', runTest, false);
</script>
</head>
<body onload="runTest()">
<div contenteditable id="editable">Ti</div>
<p>To manually test, type 'Ti' into the contenteditable, select it, then tap the autocorrection in the keyboard. The 'Ti' should be autocorrected.</p>
<code><div id="output"></div></code>
</body>
</html>