Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / editing / input / ime-composition-clearpreedit.html
blob53da99e3be3fee017e92fbe5bcfac771db2bee1a
1 <html>
2 <head>
3 <title></title>
4 </head>
5 <body>
6 <p>This tests that clearing a text compose doesn't leave the composed text behild in the text field</p>
7 <p>To test manually, enable an IME, input characters, clear the compose and see if the input field only contains the initial value</p>
8 <input id="test" type="text" value=""/>
9 <ul id="console"></ul>
10 <script language="javascript" type="text/javascript">
11 function log(str) {
12 var li = document.createElement('li');
13 li.appendChild(document.createTextNode(str));
14 var console = document.getElementById('console');
15 console.appendChild(li);
18 var test = document.getElementById('test');
19 test.focus();
21 if (window.testRunner) {
22 testRunner.dumpAsText();
24 // Compose text.
25 textInputController.setMarkedText('5', 5, 1);
26 textInputController.setMarkedText('6', 5, 1);
27 textInputController.setMarkedText('7', 5, 1);
29 // Verify that the input field contains the composed value
30 log(test.value == "7" ? "SUCCESS COMPOSE" : "FAILED COMPOSE");
32 textInputController.setMarkedText('', 0, 1);
34 // Verify that the input field only contains its initial value
35 log(test.value == "" ? "SUCCESS CLEAR" : "FAILED CLEAR");
37 </script>
38 </body>
39 </html>