Chromium Code Reviews| 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..391f2a5346e04cb34a0f3c1b62b1c0821ff79fbe 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,24 @@ |
| <!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 (var i = 0; i < 12; ++i) |
|
yosin_UTC9
2016/10/26 08:15:33
nit: s/var/let/
Xiaocheng
2016/10/26 08:19:25
Done.
|
| + testRunner.execCommand('DeleteBackward'); |
| + }, |
| + '<div contenteditable>You ha</div>', |
| + 'Remove grammar markers when editing a grammatically-incorrect word.' |
| + ) |
| + }); |
| </script> |
| -</body> |
| -</html> |