Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!DOCTYPE html> | |
| 2 <html> | |
| 3 <head> | |
| 4 <script src="../editing.js"></script> | |
| 5 <script src="resources/util.js"></script> | |
| 6 <script src="../../fast/js/resources/js-test-pre.js"></script> | |
| 7 </head> | |
| 8 <body onload="test();"> | |
| 9 <pre id="console"></pre> | |
| 10 <div id="container"> | |
| 11 <div id="test_editable" contentEditable>zz zz zz. </div> | |
| 12 <textarea id="test_textarea">zz zz zz.</textarea> | |
| 13 <input type="text" id="test_textfield" value="zz zz zz."></input> | |
| 14 </div> | |
| 15 <script> | |
| 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 " + | |
| 18 "should be marked on focus."); | |
| 19 | |
| 20 var testEditable = document.getElementById('test_editable'); | |
| 21 var testTextArea = document.getElementById('test_textarea'); | |
| 22 var testTextField = document.getElementById('test_textfield'); | |
| 23 | |
| 24 function test() | |
| 25 { | |
| 26 if (!window.internals) | |
| 27 { | |
| 28 log("Automatic testing impossible. Test manually."); | |
| 29 return; | |
| 30 } | |
| 31 | |
| 32 internals.settings.setUnifiedTextCheckerEnabled(true); | |
| 33 internals.settings.setAsynchronousSpellCheckingEnabled(false); | |
|
please use gerrit instead
2013/08/20 18:33:52
Please also add the same test for asynchronous spe
pstanek
2013/08/20 20:44:43
Done.
| |
| 34 internals.setContinuousSpellCheckingEnabled(true); | |
| 35 | |
| 36 shouldBe('internals.markerCountForNode(findFirstTextNode(testEditable), "spe lling")', '0'); | |
| 37 testEditable.focus(); | |
| 38 shouldBe('internals.markerCountForNode(findFirstTextNode(testEditable), "spe lling")', '3'); | |
| 39 shouldBe('internals.markerCountForNode(findFirstTextNode(testTextArea), "spe lling")', '0'); | |
| 40 testTextArea.focus(); | |
| 41 shouldBe('internals.markerCountForNode(findFirstTextNode(testTextArea), "spe lling")', '3'); | |
| 42 shouldBe('internals.markerCountForNode(findFirstTextNode(testTextField), "sp elling")', '0'); | |
| 43 testTextField.focus(); | |
| 44 shouldBe('internals.markerCountForNode(findFirstTextNode(testTextField), "sp elling")', '3'); | |
| 45 | |
| 46 } | |
| 47 | |
| 48 </script> | |
| 49 <script src="../../fast/js/resources/js-test-post.js"></script> | |
| 50 </body> | |
| 51 </html> | |
| OLD | NEW |