4 <script src=
"../../resources/js-test.js"></script>
6 <body onload=
"test();">
7 <div id=
"console"></div>
8 <div id=
"editable" contenteditable
></div>
11 description("Text to check is divided into chunks to make sure checking some huge text " +
12 "does not freeze the page/UI. With the asynchronous spell checker the whole text is checked. " +
13 "To test manaully trigger spell checking of the editable (e.g. by copy+paste) with unified " +
14 "and asynchronous checker on. There should be 6 misspellings marked.");
18 var testEditable
= null;
22 testEditable
= document
.getElementById("editable");
24 var longText
= "Good good good good good good good good good good good good good. " +
25 "Good good good good good good good good good good good good good. " +
26 "Good good good good good good good good good good good good good. " +
27 "Good good good good good good good good good good good good good.";
29 var testLongText
= "";
30 for (var i
= 0; i
< loopCount
; ++i
)
31 testLongText
+= longText
;
33 testLongText
= "zz zz zz. " + testLongText
+ " zz zz zz.";
34 testEditable
.innerText
= testLongText
;
36 if (!window
.internals
) {
37 log("Test manually. See the description for steps");
41 internals
.settings
.setUnifiedTextCheckerEnabled(true);
42 internals
.settings
.setAsynchronousSpellCheckingEnabled(true);
44 internals
.setContinuousSpellCheckingEnabled(false);
46 internals
.setContinuousSpellCheckingEnabled(true);
47 shouldBecomeEqual('internals.markerCountForNode(testEditable.childNodes[0], "spelling")', '6', function() {
48 testEditable
.removeChild(testEditable
.childNodes
[0]);
50 }, 5000 /* huge text needs more time to be spell checked */);