Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(293)

Side by Side Diff: LayoutTests/fast/ime/composition-offsets.html

Issue 1162853002: Remove IME API from Blink (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: remove interface in WebWidgets.h Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 <html>
2 <head>
3 <script src="../../resources/js-test.js"></script>
4 </head>
5 <body>
6 <input id="input"><textarea id="textarea"></textarea>
7 <script>
8 description('This tests composition{Start,End}Offset attributes of InputMethodCo ntext.');
9
10 var input = document.getElementById('input');
11 var context = input.inputMethodContext;
12 input.focus();
13
14 textInputController.setMarkedText('abcde', 1, 3);
15 shouldEvaluateTo('context.compositionStartOffset', 0);
16 shouldEvaluateTo('context.compositionEndOffset', 5);
17 context.confirmComposition();
18 shouldBeEqualToString('input.value', 'abcde');
19
20 textInputController.setMarkedText('fgh', 0, 3);
21 shouldEvaluateTo('context.compositionStartOffset', 5);
22 shouldEvaluateTo('context.compositionEndOffset', 8);
23 context.confirmComposition();
24 shouldBeEqualToString('input.value', 'abcdefgh');
25
26 input.value = '12345';
27 input.selectionStart = 3;
28 input.selectionEnd = 3;
29 textInputController.setMarkedText('XYZ', 0, 3);
30 shouldBeEqualToString('input.value', '123XYZ45');
31 shouldEvaluateTo('context.compositionStartOffset', 3);
32 shouldEvaluateTo('context.compositionEndOffset', 6);
33 context.confirmComposition();
34
35 var textarea = document.getElementById('textarea');
36 var context2 = textarea.inputMethodContext;
37 textarea.focus();
38
39 textInputController.setMarkedText('abcde', 1, 3);
40 shouldEvaluateTo('context2.compositionStartOffset', 0);
41 shouldEvaluateTo('context2.compositionEndOffset', 5);
42 context2.confirmComposition();
43 shouldBeEqualToString('textarea.value', 'abcde');
44
45 textInputController.setMarkedText('fgh', 0, 3);
46 shouldEvaluateTo('context2.compositionStartOffset', 5);
47 shouldEvaluateTo('context2.compositionEndOffset', 8);
48 context2.confirmComposition();
49 shouldBeEqualToString('textarea.value', 'abcdefgh');
50
51 textarea.value = '12345';
52 textarea.selectionStart = 3;
53 textarea.selectionEnd = 3;
54 textInputController.setMarkedText('XYZ', 0, 3);
55 shouldBeEqualToString('textarea.value', '123XYZ45');
56 shouldEvaluateTo('context2.compositionStartOffset', 3);
57 shouldEvaluateTo('context2.compositionEndOffset', 6);
58 context2.confirmComposition();
59 </script>
60 </body>
61 </html>
OLDNEW
« no previous file with comments | « LayoutTests/fast/ime/candidatewindowevent-expected.txt ('k') | LayoutTests/fast/ime/composition-offsets-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698