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

Side by Side Diff: LayoutTests/editing/spelling/spelling-huge-text.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"></script> 4 <script src="../../fast/js/resources/js-test-pre.js"></script>
5 </head> 5 </head>
6 <body onload="test();"> 6 <body onload="test();">
7 <div id="console"></div> 7 <div id="console"></div>
8 <div id="editable" contenteditable></div> 8 <div id="editable" contenteditable></div>
9 9
10 <script> 10 <script>
(...skipping 23 matching lines...) Expand all
34 testEditable.innerText = testLongText; 34 testEditable.innerText = testLongText;
35 35
36 if (!window.internals) { 36 if (!window.internals) {
37 log("Test manually. See the description for steps"); 37 log("Test manually. See the description for steps");
38 return; 38 return;
39 } 39 }
40 40
41 internals.settings.setUnifiedTextCheckerEnabled(true); 41 internals.settings.setUnifiedTextCheckerEnabled(true);
42 internals.settings.setAsynchronousSpellCheckingEnabled(true); 42 internals.settings.setAsynchronousSpellCheckingEnabled(true);
43 43
44 function waitForMarkersToAppear(node, nretry)
45 {
46 if (nretry > 0 && internals.markerCountForNode(node, "spelling") < 6) {
47 window.setTimeout(function() { waitForMarkersToAppear(node, nretry - 1); }, 1);
48 } else {
49 shouldBe('internals.markerCountForNode(testEditable.childNodes[0], " spelling")', '6');
50 testEditable.removeChild(testEditable.childNodes[0]);
51 finishJSTest();
52 }
53 }
54
55 if (window.testRunner) { 44 if (window.testRunner) {
56 testRunner.dumpAsText(); 45 testRunner.dumpAsText();
57 testRunner.waitUntilDone(); 46 testRunner.waitUntilDone();
58 } 47 }
59 48
60 internals.setContinuousSpellCheckingEnabled(false); 49 internals.setContinuousSpellCheckingEnabled(false);
61 testEditable.focus(); 50 testEditable.focus();
62 internals.setContinuousSpellCheckingEnabled(true); 51 internals.setContinuousSpellCheckingEnabled(true);
63 waitForMarkersToAppear(testEditable.childNodes[0], 10); 52 shouldBecomeEqual('internals.markerCountForNode(testEditable.childNodes[0], "spelling")', '6', function() {
53 testEditable.removeChild(testEditable.childNodes[0]);
54 finishJSTest();
55 });
64 } 56 }
65 </script> 57 </script>
66 <script src="../../fast/js/resources/js-test-post.js"></script> 58 <script src="../../fast/js/resources/js-test-post.js"></script>
67 </body> 59 </body>
68 </html> 60 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698