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="../../resources/js-test.js"></script> | 6 <script src="../../resources/js-test.js"></script> |
7 </head> | 7 </head> |
8 <body> | 8 <body> |
9 <div id="container"> | 9 <div id="container"> |
10 <div id="test_editable" contentEditable>zz zz zz.</div> | 10 <div id="test_editable" contentEditable>zz zz zz.</div> |
11 <textarea id="test_textarea">zz zz zz.</textarea> | 11 <textarea id="test_textarea">zz zz zz.</textarea> |
12 <input type="text" id="test_textfield" value="zz zz zz."></input> | 12 <input type="text" id="test_textfield" value="zz zz zz."></input> |
13 </div> | 13 </div> |
14 <script> | 14 <script> |
15 description("Spell checking should be triggered on focus of an editable. " | 15 description("Spell checking should be triggered on focus of an editable. " |
16 + "To test manually, set focus on above elements. The test succeed if " | 16 + "To test manually, set focus on above elements. The test succeed if " |
17 + "misspellings are marked."); | 17 + "misspellings are marked."); |
18 | 18 |
19 jsTestIsAsync = true; | 19 jsTestIsAsync = true; |
| 20 if (window.testRunner) |
| 21 testRunner.setMockSpellCheckerEnabled(true); |
20 | 22 |
21 function findFirstTextNodeOf(id) { | 23 function findFirstTextNodeOf(id) { |
22 return findFirstTextNode(document.getElementById(id)); | 24 return findFirstTextNode(document.getElementById(id)); |
23 } | 25 } |
24 | 26 |
25 var expectedNumberOfMarkers = "0"; | 27 var expectedNumberOfMarkers = "0"; |
26 function checkMarkersFor(elementID, doFocus, continuation) { | 28 function checkMarkersFor(elementID, doFocus, continuation) { |
27 var element = document.getElementById(elementID); | 29 var element = document.getElementById(elementID); |
28 if (doFocus) | 30 if (doFocus) |
29 element.focus(); | 31 element.focus(); |
(...skipping 20 matching lines...) Expand all Loading... |
50 } | 52 } |
51 | 53 |
52 // Check whether non-focused elements do not have spelling markers, then | 54 // Check whether non-focused elements do not have spelling markers, then |
53 // verify them when they get focused. | 55 // verify them when they get focused. |
54 verifySpellingMarkers(false); | 56 verifySpellingMarkers(false); |
55 } | 57 } |
56 test(); | 58 test(); |
57 </script> | 59 </script> |
58 </body> | 60 </body> |
59 </html> | 61 </html> |
OLD | NEW |