Index: LayoutTests/editing/spelling/spelling-backward.html |
diff --git a/LayoutTests/editing/spelling/spelling-backward.html b/LayoutTests/editing/spelling/spelling-backward.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..f2dc5145e6b87fbf6e6ff725ae00def05a01255a |
--- /dev/null |
+++ b/LayoutTests/editing/spelling/spelling-backward.html |
@@ -0,0 +1,34 @@ |
+<!DOCTYPE html> |
+<html> |
+<body> |
+<script src="../../resources/js-test.js"></script> |
+<script src="../../editing/editing.js"></script> |
+<div id="div" contenteditable="true"></div> |
+<script> |
+description('This tests for a bug when moving the caret backward through ' |
+ + 'a misspelled word. Once the caret is no longer adjacent to it, ' |
+ + 'it should be marked as misspelled.'); |
+ |
+jsTestIsAsync = true; |
+ |
+if (window.internals) { |
+ internals.settings.setUnifiedTextCheckerEnabled(true); |
+ internals.settings.setAsynchronousSpellCheckingEnabled(true); |
+} |
+ |
+var div = document.getElementById("div"); |
+div.focus(); |
+document.execCommand("InsertText", false, "This sentence ends with a misspelled word asd."); |
+ |
+moveSelectionBackwardByCharacterCommand(); |
+moveSelectionBackwardByCharacterCommand(); |
+moveSelectionBackwardByCharacterCommand(); |
+moveSelectionBackwardByCharacterCommand(); |
+moveSelectionBackwardByCharacterCommand(); |
+moveSelectionBackwardByCharacterCommand(); |
+ |
+if (window.internals) |
+ shouldBecomeEqual("internals.hasSpellingMarker(document, 42, 3)", "true", finishJSTest); |
+</script> |
+</body> |
+</html> |