OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <body> | 3 <body> |
4 <script src="../../resources/js-test.js"></script> | 4 <script src="../../resources/js-test.js"></script> |
5 <script src="../../editing/editing.js"></script> | 5 <script src="../../editing/editing.js"></script> |
6 <div id="div" contenteditable="true"></div> | 6 <div id="div" contenteditable="true"></div> |
7 <script> | 7 <script> |
8 description('This tests for a bug when moving the caret backward through ' | 8 description('This tests for a bug when moving the caret backward through ' |
9 + 'a misspelled word. Once the caret is no longer adjacent to it, ' | 9 + 'a misspelled word. Once the caret is no longer adjacent to it, ' |
10 + 'it should be marked as misspelled.'); | 10 + 'it should be marked as misspelled.'); |
11 | 11 |
12 jsTestIsAsync = true; | 12 jsTestIsAsync = true; |
| 13 if (window.testRunner) |
| 14 testRunner.setMockSpellCheckerEnabled(true); |
13 | 15 |
14 var div = document.getElementById("div"); | 16 var div = document.getElementById("div"); |
15 div.focus(); | 17 div.focus(); |
16 document.execCommand("InsertText", false, "This sentence ends with a misspelled
word asd."); | 18 document.execCommand("InsertText", false, "This sentence ends with a misspelled
word asd."); |
17 | 19 |
18 moveSelectionBackwardByCharacterCommand(); | 20 moveSelectionBackwardByCharacterCommand(); |
19 moveSelectionBackwardByCharacterCommand(); | 21 moveSelectionBackwardByCharacterCommand(); |
20 moveSelectionBackwardByCharacterCommand(); | 22 moveSelectionBackwardByCharacterCommand(); |
21 moveSelectionBackwardByCharacterCommand(); | 23 moveSelectionBackwardByCharacterCommand(); |
22 moveSelectionBackwardByCharacterCommand(); | 24 moveSelectionBackwardByCharacterCommand(); |
23 moveSelectionBackwardByCharacterCommand(); | 25 moveSelectionBackwardByCharacterCommand(); |
24 | 26 |
25 if (window.internals) | 27 if (window.internals) |
26 shouldBecomeEqual("internals.hasSpellingMarker(document, 42, 3)", "true", fi
nishJSTest); | 28 shouldBecomeEqual("internals.hasSpellingMarker(document, 42, 3)", "true", fi
nishJSTest); |
27 </script> | 29 </script> |
28 </body> | 30 </body> |
29 </html> | 31 </html> |
OLD | NEW |