Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!DOCTYPE html> | |
| 2 <html> | |
| 3 <head> | |
| 4 <script src="../../fast/js/resources/js-test-pre.js"></script> | |
| 5 </head> | |
| 6 <body onload="test();"> | |
| 7 <div id="console"></div> | |
| 8 <div id="editable" contenteditable></div> | |
| 9 | |
| 10 <script> | |
| 11 description("With the asynchronous spell checking text to check if divided into chunks. " + | |
| 12 "This makes sure some huge text is entirely checked and it does not freeze the p age. " + | |
| 13 "To test manaully trigger spell checking of the editable (e.g. by copy+paste) wi th unified " + | |
| 14 "and asynchronous spell checking on. The last misspelled word should be marked." ); | |
| 15 | |
| 16 var testEditable = null; | |
| 17 | |
| 18 function test() | |
| 19 { | |
| 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."; | |
| 26 testEditable.focus(); | |
| 27 for (var i = 0; i < loopCount; ++i) | |
| 28 testEditable.innerText += longText; | |
| 29 testEditable.innerText += " zz." | |
| 30 | |
| 31 if (!window.internals) { | |
| 32 log("Test manually. See the description for steps"); | |
| 33 return; | |
| 34 } | |
| 35 | |
| 36 internals.settings.setUnifiedTextCheckerEnabled(true); | |
| 37 internals.settings.setAsynchronousSpellCheckingEnabled(true); | |
| 38 | |
| 39 function waitForMarkersToAppear(node, nretry) | |
| 40 { | |
| 41 if (nretry && !internals.markerCountForNode(node, "spelling")) { | |
| 42 window.setTimeout(function() { waitForMarkersToAppear(node, nretry - 1); }, 1000); | |
|
tony
2013/08/13 22:06:15
Tests should finish quickly. We shouldn't be wait
| |
| 43 } else { | |
| 44 shouldBe('internals.markerCountForNode(testEditable.childNodes[0], " spelling")', '1'); | |
| 45 if (window.testRunner) | |
| 46 testRunner.notifyDone(); | |
| 47 } | |
| 48 } | |
| 49 | |
| 50 if (window.testRunner) { | |
| 51 testRunner.dumpAsText(); | |
| 52 testRunner.waitUntilDone(); | |
| 53 } | |
| 54 | |
| 55 internals.setContinuousSpellCheckingEnabled(false); | |
| 56 internals.setContinuousSpellCheckingEnabled(true); | |
| 57 waitForMarkersToAppear(testEditable.childNodes[0], 10); | |
| 58 } | |
| 59 </script> | |
| 60 <script src="../../fast/js/resources/js-test-post.js"></script> | |
| 61 </body> | |
| 62 </html> | |
| OLD | NEW |