4 <script src=
"../editing.js"></script>
5 <script src=
"resources/util.js"></script>
6 <script src=
"../../resources/js-test.js"></script>
9 <pre id=
"console"></pre>
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>
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.");
20 var testEditable
= document
.getElementById('test_editable');
21 var testTextArea
= document
.getElementById('test_textarea');
22 var testTextField
= document
.getElementById('test_textfield');
24 if (!window
.internals
) {
25 log("Automatic testing impossible. Test manually.");
27 internals
.settings
.setUnifiedTextCheckerEnabled(true);
28 internals
.settings
.setAsynchronousSpellCheckingEnabled(false);
29 internals
.setContinuousSpellCheckingEnabled(true);
31 shouldBe('internals.markerCountForNode(findFirstTextNode(testEditable), "spelling")', '0');
33 shouldBe('internals.markerCountForNode(findFirstTextNode(testEditable), "spelling")', '3');
34 shouldBe('internals.markerCountForNode(findFirstTextNode(testTextArea), "spelling")', '0');
36 shouldBe('internals.markerCountForNode(findFirstTextNode(testTextArea), "spelling")', '3');
37 shouldBe('internals.markerCountForNode(findFirstTextNode(testTextField), "spelling")', '0');
38 testTextField
.focus();
39 shouldBe('internals.markerCountForNode(findFirstTextNode(testTextField), "spelling")', '3');