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> | |
| 7 <div id="container"> | |
| 8 <div id="destination" contentEditable></div> | |
| 9 </div> | |
| 10 | |
| 11 <script> | |
| 12 | |
| 13 description("Spell check markers should be removed when disabling spell checker but " + | |
| 14 " they should be restored if spell checker gets enabled and an editable is focus ed."); | |
| 15 | |
| 16 internals.settings.setAsynchronousSpellCheckingEnabled(false); | |
|
abarth-chromium
2013/07/31 00:42:14
Usually we check whether window.internals is avail
| |
| 17 | |
| 18 function waitForMarkersToAppear(node, nretry) | |
| 19 { | |
| 20 if (nretry && !internals.markerCountForNode(node, "spelling")) { | |
| 21 window.setTimeout(function() { waitForMarkersToAppear(node, nretry - 1); }, 0); | |
| 22 } | |
| 23 } | |
| 24 | |
| 25 var destination = document.getElementById("destination"); | |
| 26 destination.focus(); | |
| 27 document.execCommand("InsertText", false, "zz."); | |
| 28 var node = destination.childNodes[0]; | |
| 29 waitForMarkersToAppear(node, 10); | |
| 30 shouldBe('internals.markerCountForNode(node, "spelling")', '1'); | |
| 31 internals.setContinuousSpellCheckingEnabled(false); | |
| 32 shouldBe('internals.markerCountForNode(node, "spelling")', '0'); | |
| 33 internals.setContinuousSpellCheckingEnabled(true); | |
| 34 waitForMarkersToAppear(node, 10); | |
| 35 shouldBe('internals.markerCountForNode(node, "spelling")', '1'); | |
| 36 | |
| 37 </script> | |
| 38 <script src="../../fast/js/resources/js-test-post.js"></script> | |
| 39 </body> | |
| 40 </html> | |
| OLD | NEW |