4 <title> Testcase for bug crbug.com/
242715 </title>
5 <script src=
"../../resources/js-test.js"></script>
8 description('This test ensures WebKit clears IME composition inside an input element \
9 when the value is programmatically set.');
11 var test
= document
.getElementById('test');
12 test
.addEventListener('keyup', function(event
) {
13 if (event
.keyCode
== 40)
14 test
.value
= 'henhao';
18 test
.selectionStart
= 0;
19 test
.selectionEnd
= 0;
20 textInputController
.setMarkedText("nihao", 0, 5);
22 debug('nihao should marked from 0 to 5');
23 shouldBeTrue("textInputController.hasMarkedText()");
24 shouldBeEqualToString("textInputController.markedRange().toString()", "0,5");
27 debug('text was removed so there should be no marked text');
28 shouldBeFalse("textInputController.hasMarkedText()");
30 textInputController
.setMarkedText("nihao", 0, 5);
31 debug('nihao should marked from 0 to 5');
32 shouldBeTrue("textInputController.hasMarkedText()");
33 shouldBeEqualToString("textInputController.markedRange().toString()", "0,5");
35 eventSender
.keyDown('downArrow');
37 debug('the text was changed so there should be no marked text');
38 shouldBeFalse("textInputController.hasMarkedText()");
40 document
.body
.removeChild(test
);
41 isSuccessfullyParsed();
45 <body onload=
"runTest();">
46 <input id=
"test" type=
"text">
47 <div id=
"description"></div>
48 <div id=
"console"></div>