summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/forms/text/input-delete.html
blob: 63724fec08462429de7dc6d995a9dd58ba78a92f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<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);
    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>