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

Side by Side Diff: LayoutTests/fast/ime/html-getinputcontext.html

Issue 23526025: Add test for getting different InputMethodContext for different elements. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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/html-getinputcontext-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
1 <html> 1 <html>
2 <head> 2 <head>
3 <script src="../js/resources/js-test-pre.js"></script> 3 <script src="../js/resources/js-test-pre.js"></script>
4 </head> 4 </head>
5 <body> 5 <body>
6 <input id="input">
7 <input id="input2">
6 <script> 8 <script>
7 description("This tests inputMethodContext attribute which is an additional inte rface for HTMLElement."); 9 description("This tests inputMethodContext attribute which is an additional inte rface for HTMLElement.");
8 10
9 var html = document.documentElement; 11 var html = document.documentElement;
10 12
11 // Checks creating an InputMethodContext object via new throws exception. 13 // Checks creating an InputMethodContext object via new throws exception.
12 shouldThrow('new InputMethodContext()'); 14 shouldThrow('new InputMethodContext()');
13 15
14 // Checks existence of .inputMethodContext attribute. 16 // Checks existence of .inputMethodContext attribute.
15 shouldBeNonNull(html.inputMethodContext); 17 shouldBeNonNull(html.inputMethodContext);
16 shouldBeEqualToString('typeof(html.inputMethodContext)', 'object'); 18 shouldBeEqualToString('typeof(html.inputMethodContext)', 'object');
17 19
18 // Checks inputMethodContext returns an InputMethodContext object. 20 // Checks inputMethodContext returns an InputMethodContext object.
19 var context = html.inputMethodContext; 21 var context = html.inputMethodContext;
20 shouldBeTrue('context instanceof InputMethodContext'); 22 shouldBeTrue('context instanceof InputMethodContext');
21 23
22 // Checks the same InputMethodContext objects are returned from an element. 24 // Checks the same InputMethodContext objects are returned from an element.
23 var context2 = html.inputMethodContext; 25 var context2 = html.inputMethodContext;
24 shouldBeTrue('context2 instanceof InputMethodContext'); 26 shouldBeTrue('context2 instanceof InputMethodContext');
25 shouldBeTrue('context === context2'); 27 shouldBeTrue('context === context2');
28
29 // Checks if contexts for different elements are different.
30 var input = document.getElementById('input');
31 var input2 = document.getElementById('input2');
32 shouldBeTrue('input != input2');
tkent 2013/09/09 00:29:19 Do you mean shouldNotBe('input.inputMethodContext'
kochi 2013/09/09 05:07:18 Oops, right - sorry for overlooking the obvious an
26 </script> 33 </script>
27 <script src="../js/resources/js-test-post.js"></script> 34 <script src="../js/resources/js-test-post.js"></script>
28 </body> 35 </body>
29 </html> 36 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/fast/ime/html-getinputcontext-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698