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

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

Issue 23534071: Use shouldBecomeEqual in asynchronous spellchecking tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink@master
Patch Set: Apply Tony's review and use asynchronous spellchecking in two tests Created 7 years, 3 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
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <script src=../../fast/js/resources/js-test-pre.js language="javascript" type="t ext/javascript"></script> 4 <script src=../../fast/js/resources/js-test-pre.js language="javascript" type="t ext/javascript"></script>
5 <title>Testing moving cursor to a misspelled word</title> 5 <title>Testing moving cursor to a misspelled word</title>
6 </head> 6 </head>
7 <body> 7 <body>
8 <div id="src" contenteditable="true" spellcheck="true"></div><br/> 8 <div id="src" contenteditable="true" spellcheck="true"></div><br/>
9 <script language="javascript"> 9 <script language="javascript">
10 description('Test if Chrome spellchecks a word again when changing a misspelled word.' + 10 description('Test if Chrome spellchecks a word again when changing a misspelled word.' +
(...skipping 10 matching lines...) Expand all
21 shouldBeTrue('insertText("z"); insertText("z"); insertText(" "); internals.hasSp ellingMarker(document, 0, 2)'); 21 shouldBeTrue('insertText("z"); insertText("z"); insertText(" "); internals.hasSp ellingMarker(document, 0, 2)');
22 22
23 debug('Enable asynchronous spellchecking, delete two characters, and insert a sp ace'); 23 debug('Enable asynchronous spellchecking, delete two characters, and insert a sp ace');
24 internals.settings.setAsynchronousSpellCheckingEnabled(true); 24 internals.settings.setAsynchronousSpellCheckingEnabled(true);
25 internals.settings.setUnifiedTextCheckerEnabled(true); 25 internals.settings.setUnifiedTextCheckerEnabled(true);
26 26
27 testRunner.execCommand("DeleteBackward"); 27 testRunner.execCommand("DeleteBackward");
28 testRunner.execCommand("DeleteBackward"); 28 testRunner.execCommand("DeleteBackward");
29 document.execCommand("InsertText", false, ' '); 29 document.execCommand("InsertText", false, ' ');
30 30
31 var retryCount = 10; 31 shouldBecomeEqual('internals.hasSpellingMarker(document, 0, 1)', 'false', finish JSTest);
32 function verifyMarker() {
33 var hasMarker = internals.hasSpellingMarker(document, 0, 1);
34 if (hasMarker && --retryCount > 0) {
35 window.setTimeout(verifyMarker, 1);
36 return;
37 }
38 shouldBeFalse('internals.hasSpellingMarker(document, 0, 1)');
39 finishJSTest();
40 }
41 window.setTimeout(verifyMarker, 1);
42 </script> 32 </script>
43 <script src="../../fast/js/resources/js-test-post.js"></script> 33 <script src="../../fast/js/resources/js-test-post.js"></script>
44 </body> 34 </body>
45 </html> 35 </html>
OLDNEW
« no previous file with comments | « LayoutTests/TestExpectations ('k') | LayoutTests/editing/spelling/delete-misspelled-word-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698