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

Side by Side Diff: third_party/WebKit/LayoutTests/editing/spelling/spellcheck-editable-on-focus-sync.html

Issue 2235643002: Code cleanup related to unified text checker (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@EnableUnifiedTextCheckerByDefault
Patch Set: Rebased on removal of grammar-checking code Created 4 years, 4 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
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <script src="../editing.js"></script> 4 <script src="../editing.js"></script>
5 <script src="resources/util.js"></script> 5 <script src="resources/util.js"></script>
6 <script src="../../resources/js-test.js"></script> 6 <script src="../../resources/js-test.js"></script>
7 </head> 7 </head>
8 <body> 8 <body>
9 <pre id="console"></pre> 9 <pre id="console"></pre>
10 <div id="container"> 10 <div id="container">
11 <div id="test_editable" contentEditable>zz zz zz. </div> 11 <div id="test_editable" contentEditable>zz zz zz. </div>
12 <textarea id="test_textarea">zz zz zz.</textarea> 12 <textarea id="test_textarea">zz zz zz.</textarea>
13 <input type="text" id="test_textfield" value="zz zz zz."></input> 13 <input type="text" id="test_textfield" value="zz zz zz."></input>
14 </div> 14 </div>
15 <script> 15 <script>
16 description("Spell checking should be triggered on focus of an editable. " + 16 description("Spell checking should be triggered on focus of an editable. " +
17 "To test manually type focus above editable and textarea. Misspellings in them " + 17 "To test manually type focus above editable and textarea. Misspellings in them " +
18 "should be marked on focus."); 18 "should be marked on focus.");
19 19
20 var testEditable = document.getElementById('test_editable'); 20 var testEditable = document.getElementById('test_editable');
21 var testTextArea = document.getElementById('test_textarea'); 21 var testTextArea = document.getElementById('test_textarea');
22 var testTextField = document.getElementById('test_textfield'); 22 var testTextField = document.getElementById('test_textfield');
23 23
24 if (!window.internals) { 24 if (!window.internals) {
25 log("Automatic testing impossible. Test manually."); 25 log("Automatic testing impossible. Test manually.");
26 } else { 26 } else {
27 internals.settings.setUnifiedTextCheckerEnabled(true);
28 internals.setContinuousSpellCheckingEnabled(true); 27 internals.setContinuousSpellCheckingEnabled(true);
29 28
30 shouldBe('internals.markerCountForNode(findFirstTextNode(testEditable), "spe lling")', '0'); 29 shouldBe('internals.markerCountForNode(findFirstTextNode(testEditable), "spe lling")', '0');
31 testEditable.focus(); 30 testEditable.focus();
32 shouldBe('internals.markerCountForNode(findFirstTextNode(testEditable), "spe lling")', '3'); 31 shouldBe('internals.markerCountForNode(findFirstTextNode(testEditable), "spe lling")', '3');
33 shouldBe('internals.markerCountForNode(findFirstTextNode(testTextArea), "spe lling")', '0'); 32 shouldBe('internals.markerCountForNode(findFirstTextNode(testTextArea), "spe lling")', '0');
34 testTextArea.focus(); 33 testTextArea.focus();
35 shouldBe('internals.markerCountForNode(findFirstTextNode(testTextArea), "spe lling")', '3'); 34 shouldBe('internals.markerCountForNode(findFirstTextNode(testTextArea), "spe lling")', '3');
36 shouldBe('internals.markerCountForNode(findFirstTextNode(testTextField), "sp elling")', '0'); 35 shouldBe('internals.markerCountForNode(findFirstTextNode(testTextField), "sp elling")', '0');
37 testTextField.focus(); 36 testTextField.focus();
38 shouldBe('internals.markerCountForNode(findFirstTextNode(testTextField), "sp elling")', '3'); 37 shouldBe('internals.markerCountForNode(findFirstTextNode(testTextField), "sp elling")', '3');
39 } 38 }
40 </script> 39 </script>
41 </body> 40 </body>
42 </html> 41 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698