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

Side by Side 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 unified diff | 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 »
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 <body> 3 <script src="../../resources/testharnessreport.js"></script>
4 <script src="../../resources/js-test.js"></script> 4 <script src="../assert_selection.js"></script>
5 <script src="../../editing/editing.js"></script> 5 <script src="spellcheck_test.js"></script>
6 <div id="div" contenteditable="true"></div> 6
7 <script> 7 <script>
8 description('This tests for a bug when moving the caret backward through ' 8 spellcheck_test(
9 + 'a misspelled word. Once the caret is no longer adjacent to it, ' 9 '<div contenteditable>|</div>',
10 + 'it should be marked as misspelled.'); 10 'insertText This sentence ends with a misspelled word asd.',
11 11 '<div contenteditable>This sentence ends with a misspelled word #asd#.</div> ',
12 jsTestIsAsync = true; 12 {
13 if (window.testRunner) 13 title: 'Mark misspelled word "asd" after typing.',
14 testRunner.setMockSpellCheckerEnabled(true); 14 callback: sample => spellcheck_test(
15 15 sample,
16 var div = document.getElementById("div"); 16 () => {
17 div.focus(); 17 const selection = sample.selection;
18 document.execCommand("InsertText", false, "This sentence ends with a misspelled word asd."); 18 selection.modify('move', 'backward', 'character');
19 19 selection.modify('move', 'backward', 'character');
20 moveSelectionBackwardByCharacterCommand(); 20 selection.modify('move', 'backward', 'character');
21 moveSelectionBackwardByCharacterCommand(); 21 selection.modify('move', 'backward', 'character');
22 moveSelectionBackwardByCharacterCommand(); 22 selection.modify('move', 'backward', 'character');
23 moveSelectionBackwardByCharacterCommand(); 23 },
24 moveSelectionBackwardByCharacterCommand(); 24 '<div contenteditable>This sentence ends with a misspelled word #asd#. </div>',
25 moveSelectionBackwardByCharacterCommand(); 25 'Misspelled word should still be marked when caret is no longer adjace nt with it.')
26 26 });
27 if (window.internals)
28 shouldBecomeEqual("internals.hasSpellingMarker(document, 42, 3)", "true", fi nishJSTest);
29 </script> 27 </script>
30 </body>
31 </html>
OLDNEW
« 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