OLD | NEW |
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="../../fast/js/resources/js-test-pre.js"></script> | 6 <script src="../../fast/js/resources/js-test-pre.js"></script> |
7 </head> | 7 </head> |
8 <body onload="test();"> | 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 function test() | 24 if (!window.internals) |
25 { | 25 { |
26 if (!window.internals) | 26 log("Automatic testing impossible. Test manually."); |
27 { | 27 return; |
28 log("Automatic testing impossible. Test manually."); | 28 } |
29 return; | |
30 } | |
31 | 29 |
32 internals.settings.setUnifiedTextCheckerEnabled(true); | 30 internals.settings.setUnifiedTextCheckerEnabled(true); |
33 internals.settings.setAsynchronousSpellCheckingEnabled(false); | 31 internals.settings.setAsynchronousSpellCheckingEnabled(false); |
34 internals.setContinuousSpellCheckingEnabled(true); | 32 internals.setContinuousSpellCheckingEnabled(true); |
35 | 33 |
36 shouldBe('internals.markerCountForNode(findFirstTextNode(testEditable), "spe
lling")', '0'); | 34 shouldBe('internals.markerCountForNode(findFirstTextNode(testEditable), "spellin
g")', '0'); |
37 testEditable.focus(); | 35 testEditable.focus(); |
38 shouldBe('internals.markerCountForNode(findFirstTextNode(testEditable), "spe
lling")', '3'); | 36 shouldBe('internals.markerCountForNode(findFirstTextNode(testEditable), "spellin
g")', '3'); |
39 shouldBe('internals.markerCountForNode(findFirstTextNode(testTextArea), "spe
lling")', '0'); | 37 shouldBe('internals.markerCountForNode(findFirstTextNode(testTextArea), "spellin
g")', '0'); |
40 testTextArea.focus(); | 38 testTextArea.focus(); |
41 shouldBe('internals.markerCountForNode(findFirstTextNode(testTextArea), "spe
lling")', '3'); | 39 shouldBe('internals.markerCountForNode(findFirstTextNode(testTextArea), "spellin
g")', '3'); |
42 shouldBe('internals.markerCountForNode(findFirstTextNode(testTextField), "sp
elling")', '0'); | 40 shouldBe('internals.markerCountForNode(findFirstTextNode(testTextField), "spelli
ng")', '0'); |
43 testTextField.focus(); | 41 testTextField.focus(); |
44 shouldBe('internals.markerCountForNode(findFirstTextNode(testTextField), "sp
elling")', '3'); | 42 shouldBe('internals.markerCountForNode(findFirstTextNode(testTextField), "spelli
ng")', '3'); |
45 | |
46 } | |
47 | 43 |
48 </script> | 44 </script> |
49 <script src="../../fast/js/resources/js-test-post.js"></script> | 45 <script src="../../fast/js/resources/js-test-post.js"></script> |
50 </body> | 46 </body> |
51 </html> | 47 </html> |
OLD | NEW |