chromium/third_party/blink/web_tests/fast/forms/text/input-delete.html

<html>
<head>
<script src="../../../editing/editing.js" language="JavaScript" type="text/JavaScript" ></script>
<script>
function test() {
    if (window.testRunner) {
        testRunner.dumpAsText();
    }
    document.getElementById('tf').setSelectionRange(5, 11);
    document.getElementById('tf').focus();
    deleteCommand();
    if (document.getElementById('tf').value == "Test Failed") {
        document.getElementById('res').innerHTML = "Failed";
    } else {
        document.getElementById('res').innerHTML = "Passed";
    }
}
</script>
</head>
<body onload="test()">
<p>This tests that calling setSelectionRange on a text field will correctly close the typing command.  If the test fails, the deleteCommand that
happens after the setSelectionRange will fail, and the text field will say "Test Failed".</p>
<input id="tf" value="Test Failed"></input>
<div id="res"></div>
</body>
</html>