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

Side by Side 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, 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <script src="../../resources/testharness.js"></script>
3 <head> 3 <script src="../../resources/testharnessreport.js"></script>
4 <script src="../../resources/js-test.js"></script> 4 <script src="../assert_selection.js"></script>
5 <title>Editing a grammatically-incorrect word</title> 5 <script src="spellcheck_test.js"></script>
6 </head> 6 <script>
7 <body> 7 spellcheck_test(
8 <div id="src" contenteditable="true" spellcheck="true"></div><br/> 8 '<div contenteditable>You has the right.|</div>',
9 <script language="javascript"> 9 '',
10 description('Test if WebKit removes grammar markers when we edit a grammatically -incorrect word. ' 10 '<div contenteditable>You ~has~ the right.</div>',
11 + 'To test manually, type a grammatically-incorrect sentence "You has the ri ght." and type ' 11 {
12 + 'a backspace key to delete the last character of "has". ' 12 title: 'Has marker on ungrammatical intial text',
13 + 'This test succeeds when "ha" does not have grammar markers.'); 13 callback: sample => spellcheck_test(
14 14 sample,
15 jsTestIsAsync = true; 15 () => {
16 if (window.testRunner) 16 // Delete the end of this sentence until it becomes 'You ha'.
17 testRunner.setMockSpellCheckerEnabled(true); 17 for (let i = 0; i < 12; ++i)
18 18 testRunner.execCommand('DeleteBackward');
19 function editAndCheckSentence() 19 },
20 { 20 '<div contenteditable>You ha</div>',
21 // Delete the end of this sentence until it becomes "You ha". 21 'Remove grammar markers when editing a grammatically-incorrect word.')
22 for (var i = 0; i < 12; ++i) 22 });
23 testRunner.execCommand("DeleteBackward");
24
25 shouldBecomeEqual('internals.hasGrammarMarker(document, 4, 2)', 'false', fin ishJSTest);
26 }
27
28 var target = document.getElementById('src');
29 target.focus();
30 document.execCommand("InsertText", false, "You has the right.");
31
32 if (window.internals)
33 shouldBecomeEqual('internals.hasGrammarMarker(document, 4, 3)', 'true', edit AndCheckSentence);
34 </script> 23 </script>
35 </body>
36 </html>
OLDNEW
« 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