4 <script src=
"resources/util.js"></script>
5 <script src=
"../../resources/js-test.js"></script>
8 <pre id=
"console"></pre>
9 <iframe id=
"frame1" src=
"data:text/html,<body></body>"></iframe>
10 <iframe id=
"frame2" src=
"data:text/html,<body></body>"></iframe>
14 description("Spell checking should be triggered on focus of an editable. " +
15 "Also after retarting spell checker. It applies to all frames." +
16 "To test manually type focus above editable. Misspellings in them " +
17 "should be marked on focus.Turn spell checker off and on again and again focus editables. " +
18 "Mispelling should be marked again");
20 var frame1
= document
.getElementById("frame1");
21 var testEditable1
= frame1
.contentWindow
.document
.createElement("div");
22 testEditable1
.setAttribute("contentEditable", "true");
23 frame1
.contentWindow
.document
.body
.appendChild(testEditable1
);
24 var frame2
= document
.getElementById("frame2");
25 var testEditable2
= frame1
.contentWindow
.document
.createElement("div");
26 testEditable2
.setAttribute("contentEditable", "true");
27 frame2
.contentWindow
.document
.body
.appendChild(testEditable2
);
28 testEditable1
.innerText
= "zz zz zz.";
29 testEditable2
.innerText
= "zz zz zz.";
31 if (window
.internals
) {
32 internals
.settings
.setUnifiedTextCheckerEnabled(true);
33 internals
.settings
.setAsynchronousSpellCheckingEnabled(false);
34 internals
.setContinuousSpellCheckingEnabled(true);
36 shouldBe('internals.markerCountForNode(testEditable1.childNodes[0], "spelling")', '0');
37 shouldBe('internals.markerCountForNode(testEditable2.childNodes[0], "spelling")', '0');
38 testEditable1
.focus();
39 shouldBe('internals.markerCountForNode(testEditable1.childNodes[0], "spelling")', '3');
40 testEditable2
.focus();
41 shouldBe('internals.markerCountForNode(testEditable1.childNodes[0], "spelling")', '3');
42 internals
.setContinuousSpellCheckingEnabled(false);
43 shouldBe('internals.markerCountForNode(testEditable1.childNodes[0], "spelling")', '0');
44 shouldBe('internals.markerCountForNode(testEditable2.childNodes[0], "spelling")', '0');
45 internals
.setContinuousSpellCheckingEnabled(true);
46 testEditable1
.focus();
47 testEditable2
.focus();
48 shouldBe('internals.markerCountForNode(testEditable1.childNodes[0], "spelling")', '3');
49 shouldBe('internals.markerCountForNode(testEditable2.childNodes[0], "spelling")', '3');
51 log("Automatic testing impossible. Test manually. See steps in the description.");