Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / editing / spelling / spelling-backward.html
1 <!DOCTYPE html>
2 <html>
3 <body>
4 <script src="../../resources/js-test.js"></script>
5 <script src="../../editing/editing.js"></script>
6 <div id="div" contenteditable="true"></div>
7 <script>
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, '
10     + 'it should be marked as misspelled.');
11
12 jsTestIsAsync = true;
13
14 if (window.internals) {
15     internals.settings.setUnifiedTextCheckerEnabled(true);
16     internals.settings.setAsynchronousSpellCheckingEnabled(true);
17 }
18
19 var div = document.getElementById("div");
20 div.focus();
21 document.execCommand("InsertText", false, "This sentence ends with a misspelled word asd.");
22
23 moveSelectionBackwardByCharacterCommand();
24 moveSelectionBackwardByCharacterCommand();
25 moveSelectionBackwardByCharacterCommand();
26 moveSelectionBackwardByCharacterCommand();
27 moveSelectionBackwardByCharacterCommand();
28 moveSelectionBackwardByCharacterCommand();
29
30 if (window.internals)
31     shouldBecomeEqual("internals.hasSpellingMarker(document, 42, 3)", "true", finishJSTest);
32 </script>
33 </body>
34 </html>