blob: 8a6ccc0f72ba11eebab24fa1f0a0b23b04e27cb1 [file] [log] [blame]
<!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);
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>