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

Side by Side Diff: third_party/WebKit/LayoutTests/editing/spelling/delete-misspelled-word.html

Issue 2224103003: Convert some spell-checking layout tests to use unified text checker (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@SpellCheckerDebugInfo
Patch Set: add setUnifiedTextCheckerEnabled(true) in util.js Created 4 years, 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/editing/spelling/delete-misspelled-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 <html>
3 <head> 3 <head>
4 <script src=../../resources/js-test.js language="javascript" type="text/javascri pt"></script> 4 <script src=../../resources/testharness.js></script>
5 <title>Testing moving cursor to a misspelled word</title> 5 <script src=../../resources/testharnessreport.js></script>
6 </head> 6 <script src=resources/util.js></script>
7 <title>Testing moving cursor to a misspelled word</title>
8 </head>
7 <body> 9 <body>
8 <div id="src" contenteditable="true" spellcheck="true"></div><br/> 10 <div id="src" contenteditable></div>
9 <script language="javascript"> 11 <script>
10 description('Test if Chrome spellchecks a word again when changing a misspelled word.' + 12 var node = document.getElementById('src');
11 'To test manually, type a misspelled word "zz " and type a backspace key twice.' +
12 'This test succeeds when "z" is not marked as misspelled.');
13 13
14 jsTestIsAsync = true; 14 var steps = [
15 function() {
16 node.focus();
17 document.execCommand('InsertText', false, 'z');
18 document.execCommand('InsertText', false, 'z');
19 document.execCommand('InsertText', false, ' ');
20 },
21 function() {
22 testRunner.execCommand('DeleteBackward');
23 testRunner.execCommand('DeleteBackward');
24 document.execCommand('InsertText', false, ' ');
25 }
26 ];
15 27
16 var node = document.getElementById('src'); 28 var assertions = [
17 node.focus(); 29 () => assert_true(internals.hasSpellingMarker(document, 0, 2)),
18 function insertText(text) { 30 () => assert_false(internals.hasSpellingMarker(document, 0, 1))
19 document.execCommand("InsertText", false, text); 31 ];
20 }
21 shouldBeTrue('insertText("z"); insertText("z"); insertText(" "); internals.hasSp ellingMarker(document, 0, 2)');
22 32
23 debug('Enable asynchronous spellchecking, delete two characters, and insert a sp ace'); 33 runSpellingTest(steps, assertions, 'Blink spellchecks a word again when changing a misspelled word');
24 internals.settings.setUnifiedTextCheckerEnabled(true);
25
26 testRunner.execCommand("DeleteBackward");
27 testRunner.execCommand("DeleteBackward");
28 document.execCommand("InsertText", false, ' ');
29
30 shouldBecomeEqual('internals.hasSpellingMarker(document, 0, 1)', 'false', finish JSTest);
31 </script> 34 </script>
32 </body> 35 </body>
33 </html> 36 </html>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/editing/spelling/delete-misspelled-word-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698