Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(990)

Unified Diff: third_party/WebKit/LayoutTests/editing/spelling/spelling-backward.html

Issue 2476193002: Convert editing/spelling/spelling-backward.html with spellcheck_test (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/editing/spelling/spelling-backward-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/editing/spelling/spelling-backward.html
diff --git a/third_party/WebKit/LayoutTests/editing/spelling/spelling-backward.html b/third_party/WebKit/LayoutTests/editing/spelling/spelling-backward.html
index 70d54fe8c976ef62e2f0f219acda8bd01d91ea33..4f52c9b970ab87dc8e67c9e9e5741df8213a528f 100644
--- a/third_party/WebKit/LayoutTests/editing/spelling/spelling-backward.html
+++ b/third_party/WebKit/LayoutTests/editing/spelling/spelling-backward.html
@@ -1,31 +1,27 @@
<!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.testRunner)
- testRunner.setMockSpellCheckerEnabled(true);
-
-var div = document.getElementById("div");
-div.focus();
-document.execCommand("InsertText", false, "This sentence ends with a misspelled word asd.");
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<script src="../assert_selection.js"></script>
+<script src="spellcheck_test.js"></script>
-moveSelectionBackwardByCharacterCommand();
-moveSelectionBackwardByCharacterCommand();
-moveSelectionBackwardByCharacterCommand();
-moveSelectionBackwardByCharacterCommand();
-moveSelectionBackwardByCharacterCommand();
-moveSelectionBackwardByCharacterCommand();
-
-if (window.internals)
- shouldBecomeEqual("internals.hasSpellingMarker(document, 42, 3)", "true", finishJSTest);
+<script>
+spellcheck_test(
+ '<div contenteditable>|</div>',
+ 'insertText This sentence ends with a misspelled word asd.',
+ '<div contenteditable>This sentence ends with a misspelled word #asd#.</div>',
+ {
+ title: 'Mark misspelled word "asd" after typing.',
+ callback: sample => spellcheck_test(
+ sample,
+ () => {
+ const selection = sample.selection;
+ selection.modify('move', 'backward', 'character');
+ selection.modify('move', 'backward', 'character');
+ selection.modify('move', 'backward', 'character');
+ selection.modify('move', 'backward', 'character');
+ selection.modify('move', 'backward', 'character');
+ },
+ '<div contenteditable>This sentence ends with a misspelled word #asd#.</div>',
+ 'Misspelled word should still be marked when caret is no longer adjacent with it.')
+ });
</script>
-</body>
-</html>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/editing/spelling/spelling-backward-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698