OLD | NEW |
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 Loading... |
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 } |
OLD | NEW |