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

Unified Diff: third_party/WebKit/LayoutTests/editing/spelling/grammar-edit-word.html

Issue 2443173002: Convert editing/spelling/grammar-edit-word.html (Closed)
Patch Set: Fix nit Created 4 years, 2 months 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/grammar-edit-word-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/grammar-edit-word.html
diff --git a/third_party/WebKit/LayoutTests/editing/spelling/grammar-edit-word.html b/third_party/WebKit/LayoutTests/editing/spelling/grammar-edit-word.html
index 871fca09161ca6c5df45069a87ec6f8f4f76adfb..7c742da67e3528e92524202e010ce7a399f05623 100644
--- a/third_party/WebKit/LayoutTests/editing/spelling/grammar-edit-word.html
+++ b/third_party/WebKit/LayoutTests/editing/spelling/grammar-edit-word.html
@@ -1,36 +1,23 @@
<!DOCTYPE html>
-<html>
-<head>
-<script src="../../resources/js-test.js"></script>
-<title>Editing a grammatically-incorrect word</title>
-</head>
-<body>
-<div id="src" contenteditable="true" spellcheck="true"></div><br/>
-<script language="javascript">
-description('Test if WebKit removes grammar markers when we edit a grammatically-incorrect word. '
- + 'To test manually, type a grammatically-incorrect sentence "You has the right." and type '
- + 'a backspace key to delete the last character of "has". '
- + 'This test succeeds when "ha" does not have grammar markers.');
-
-jsTestIsAsync = true;
-if (window.testRunner)
- testRunner.setMockSpellCheckerEnabled(true);
-
-function editAndCheckSentence()
-{
- // Delete the end of this sentence until it becomes "You ha".
- for (var i = 0; i < 12; ++i)
- testRunner.execCommand("DeleteBackward");
-
- shouldBecomeEqual('internals.hasGrammarMarker(document, 4, 2)', 'false', finishJSTest);
-}
-
-var target = document.getElementById('src');
-target.focus();
-document.execCommand("InsertText", false, "You has the right.");
-
-if (window.internals)
- shouldBecomeEqual('internals.hasGrammarMarker(document, 4, 3)', 'true', editAndCheckSentence);
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<script src="../assert_selection.js"></script>
+<script src="spellcheck_test.js"></script>
+<script>
+spellcheck_test(
+ '<div contenteditable>You has the right.|</div>',
+ '',
+ '<div contenteditable>You ~has~ the right.</div>',
+ {
+ title: 'Has marker on ungrammatical intial text',
+ callback: sample => spellcheck_test(
+ sample,
+ () => {
+ // Delete the end of this sentence until it becomes 'You ha'.
+ for (let i = 0; i < 12; ++i)
+ testRunner.execCommand('DeleteBackward');
+ },
+ '<div contenteditable>You ha</div>',
+ 'Remove grammar markers when editing a grammatically-incorrect word.')
+ });
</script>
-</body>
-</html>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/editing/spelling/grammar-edit-word-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698