| <!DOCTYPE html> |
| <html> |
| <head> |
| <script src=../../resources/js-test.js language="javascript" type="text/javascript"></script> |
| <title>Testing moving cursor to a misspelled word</title> |
| </head> |
| <body> |
| <div id="src" contenteditable="true" spellcheck="true"></div><br/> |
| <script language="javascript"> |
| description('Test if Chrome spellchecks a word again when changing a misspelled word.' + |
| 'To test manually, type a misspelled word "zz " and type a backspace key twice.' + |
| 'This test succeeds when "z" is not marked as misspelled.'); |
| |
| jsTestIsAsync = true; |
| |
| var node = document.getElementById('src'); |
| node.focus(); |
| function insertText(text) { |
| document.execCommand("InsertText", false, text); |
| } |
| shouldBeTrue('insertText("z"); insertText("z"); insertText(" "); internals.hasSpellingMarker(document, 0, 2)'); |
| |
| debug('Enable asynchronous spellchecking, delete two characters, and insert a space'); |
| internals.settings.setUnifiedTextCheckerEnabled(true); |
| |
| testRunner.execCommand("DeleteBackward"); |
| testRunner.execCommand("DeleteBackward"); |
| document.execCommand("InsertText", false, ' '); |
| |
| shouldBecomeEqual('internals.hasSpellingMarker(document, 0, 1)', 'false', finishJSTest); |
| </script> |
| </body> |
| </html> |