Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / editing / spelling / spelling-huge-text-sync.html
blob5ef3752744b1f28d920dec486f41d00e39b156e3
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../../resources/js-test.js"></script>
5 </head>
6 <body onload="test();">
7 <div id="console"></div>
8 <div id="editable" contenteditable></div>
10 <script>
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 synchronous spell checker only one chunk is checked. " +
13 "To test manaully trigger spell checking of the editable (e.g. by copy+paste) with unified " +
14 "and synchronous checker on. Only 3 first misspellings should be marked.");
16 var testEditable = null;
18 function test()
20 testEditable = document.getElementById("editable");
21 var loopCount = 150;
22 var longText = "Good good good good good good good good good good good good good. " +
23 "Good good good good good good good good good good good good good. " +
24 "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.";
27 var testLongText = "";
28 for (var i = 0; i < loopCount; ++i)
29 testLongText += longText;
31 testLongText = "zz zz zz. " + testLongText + "zz zz zz.";
32 testEditable.innerText = testLongText;
34 if (!window.internals) {
35 log("Test manually. See the description for steps");
36 return;
39 internals.settings.setUnifiedTextCheckerEnabled(true);
40 internals.settings.setAsynchronousSpellCheckingEnabled(false);
42 function waitForMarkersToAppear(node, nretry)
44 if (nretry > 0 && !internals.markerCountForNode(node, "spelling")) {
45 window.setTimeout(function() { waitForMarkersToAppear(node, nretry - 1); }, 5);
46 } else {
47 shouldBe('internals.markerCountForNode(testEditable.childNodes[0], "spelling")', '3');
48 testEditable.removeChild(testEditable.childNodes[0]);
49 if (window.testRunner)
50 testRunner.notifyDone();
54 if (window.testRunner) {
55 testRunner.waitUntilDone();
58 internals.setContinuousSpellCheckingEnabled(false);
59 testEditable.focus();
60 internals.setContinuousSpellCheckingEnabled(true);
61 waitForMarkersToAppear(testEditable.childNodes[0], 10);
63 </script>
64 </body>
65 </html>