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

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: Update for comments 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"><input id="input2">
6 <script> 7 <script>
7 description("This tests inputMethodContext attribute which is an additional inte rface for HTMLElement."); 8 description("This tests inputMethodContext attribute which is an additional inte rface for HTMLElement.");
8 9
9 var html = document.documentElement; 10 var html = document.documentElement;
10 11
11 // Checks creating an InputMethodContext object via new throws exception. 12 // Checks creating an InputMethodContext object via new throws exception.
12 shouldThrow('new InputMethodContext()'); 13 shouldThrow('new InputMethodContext()');
13 14
14 // Checks existence of .inputMethodContext attribute. 15 // Checks existence of .inputMethodContext attribute.
15 shouldBeNonNull(html.inputMethodContext); 16 shouldBeNonNull(html.inputMethodContext);
16 shouldBeEqualToString('typeof(html.inputMethodContext)', 'object'); 17 shouldBeEqualToString('typeof(html.inputMethodContext)', 'object');
17 18
18 // Checks inputMethodContext returns an InputMethodContext object. 19 // Checks inputMethodContext returns an InputMethodContext object.
19 var context = html.inputMethodContext; 20 var context = html.inputMethodContext;
20 shouldBeTrue('context instanceof InputMethodContext'); 21 shouldBeTrue('context instanceof InputMethodContext');
21 22
22 // Checks the same InputMethodContext objects are returned from an element. 23 // Checks the same InputMethodContext objects are returned from an element.
23 var context2 = html.inputMethodContext; 24 var context2 = html.inputMethodContext;
24 shouldBeTrue('context2 instanceof InputMethodContext'); 25 shouldBeTrue('context2 instanceof InputMethodContext');
25 shouldBeTrue('context === context2'); 26 shouldBeTrue('context === context2');
27
28 // Checks if contexts for different elements are different.
29 var inputContext = document.getElementById('input').inputMethodContext;
30 var input2Context = document.getElementById('input2').inputMethodContext;
31 shouldNotBe('inputContext', 'input2Context');
26 </script> 32 </script>
27 <script src="../js/resources/js-test-post.js"></script> 33 <script src="../js/resources/js-test-post.js"></script>
28 </body> 34 </body>
29 </html> 35 </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