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

Side by Side Diff: third_party/WebKit/LayoutTests/editing/spelling/resources/util.js

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
OLDNEW
1 function log(msg) 1 function log(msg)
2 { 2 {
3 document.getElementById("console").innerHTML += (msg + "\n"); 3 document.getElementById("console").innerHTML += (msg + "\n");
4 } 4 }
5 5
6 function verifySpellTest(nretry, opt_doNotFinishTest) 6 function verifySpellTest(nretry, opt_doNotFinishTest)
7 { 7 {
8 var node = window.destination; 8 var node = window.destination;
9 if (window.destination.childNodes.length > 0) 9 if (window.destination.childNodes.length > 0)
10 node = window.destination.childNodes[0]; 10 node = window.destination.childNodes[0];
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 } 59 }
60 } 60 }
61 61
62 function typeText(elem, text) 62 function typeText(elem, text)
63 { 63 {
64 elem.focus(); 64 elem.focus();
65 for (var i = 0; i < text.length; ++i) { 65 for (var i = 0; i < text.length; ++i) {
66 typeCharacterCommand(text[i]); 66 typeCharacterCommand(text[i]);
67 } 67 }
68 } 68 }
69
70 function runNextStep(test, steps, assertions) {
71 if (!steps.length) {
72 test.done();
73 return;
74 }
75
76 var step = steps.shift();
77 var assertion = assertions.shift();
78
79 step();
80 step_timeout(() => {
81 test.step(() => assertion());
82 runNextStep(test, steps, assertions);
83 }, 50);
84 }
85
86 function runSpellingTest(steps, assertions, opt_title)
87 {
88 var t = async_test(opt_title);
89 if (!window.internals) {
90 t.step(() => assert_unreached('internals is required for this test'));
91 t.done();
92 return;
93 }
94
95 internals.settings.setUnifiedTextCheckerEnabled(true);
96 runNextStep(t, steps, assertions);
97 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698