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

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

Issue 23604053: Implement Composition interface for IME API (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: consistent quotation usage in layouttest html. Created 7 years, 3 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
« no previous file with comments | « no previous file | LayoutTests/fast/ime/inputmethodcontext-composition-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <html>
2 <head>
3 <script src="../js/resources/js-test-pre.js"></script>
4 </head>
5 <body>
6 <input id="input"><input id="input2"><input id="input3">
7 <script>
8 description('This tests composition attribute of InputMethodContext.');
9
10 var input = document.getElementById('input');
11 var input2 = document.getElementById('input2');
12
13 var context = input.inputMethodContext;
14 var composition = context.composition;
15 shouldBeEqualToString('composition.text', '');
16
17 var context2 = input2.inputMethodContext;
18 var composition2 = context2.composition;
19 shouldBeEqualToString('composition2.text', '');
20
21 debug('Testing IME on an input element.');
22 input.focus();
23 textInputController.setMarkedText('abcde', 1, 3);
24 shouldBeEqualToString('composition.text', 'abcde');
25 shouldBeEqualToString('composition2.text', '');
26 shouldEvaluateTo('composition.selectionStart', 1);
27 shouldEvaluateTo('composition.selectionEnd', 4);
28 shouldEvaluateTo('composition.getSegments().length', 3);
29 textInputController.setMarkedText('abcde', 0, 3);
30 shouldEvaluateTo('composition.getSegments().length', 2);
31 textInputController.setMarkedText('abcde', 2, 3);
32 shouldEvaluateTo('composition.getSegments().length', 2);
33 context.confirmComposition();
34 shouldBeEqualToString('composition.text', '');
35 shouldEvaluateTo('composition.getSegments().length', 0);
36 shouldBeEqualToString('input.value', 'abcde');
37 shouldBeEqualToString('input2.value', '');
38
39 debug('Testing IME on another input element.');
40 input2.focus();
41 shouldBeEqualToString('input.value', 'abcde');
42 shouldBeEqualToString('input2.value', '');
43 textInputController.setComposition('fghij');
44 shouldEvaluateTo('composition.getSegments().length', 0);
45 shouldEvaluateTo('composition2.getSegments().length', 1);
46 shouldBeEqualToString('input.value', 'abcde');
47 shouldBeEqualToString('input2.value', 'fghij');
48 shouldBeEqualToString('composition.text', '');
49 shouldBeEqualToString('composition2.text', 'fghij');
50 context2.confirmComposition();
51 shouldBeEqualToString('composition2.text', '');
52 shouldBeEqualToString('input.value', 'abcde');
53 shouldBeEqualToString('input2.value', 'fghij');
54
55 debug('Testing when context is obtained after some IME input.');
56 var input3 = document.getElementById('input3');
57 input3.focus();
58 shouldBeEqualToString('input3.value', '');
59 textInputController.setComposition('klmno');
60 shouldBeEqualToString('input3.value', 'klmno');
61 var context3 = input3.inputMethodContext;
62 var composition3 = context3.composition;
63 shouldBeEqualToString('composition3.text', 'klmno');
64 context3.confirmComposition();
65 shouldBeEqualToString('composition3.text', '');
66 </script>
67 <script src="../js/resources/js-test-post.js"></script>
68 </body>
69 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/fast/ime/inputmethodcontext-composition-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698