OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Include test fixture. | 5 // Include test fixture. |
6 GEN_INCLUDE(['../../testing/chromevox_next_e2e_test_base.js']); | 6 GEN_INCLUDE(['../../testing/chromevox_next_e2e_test_base.js']); |
7 | 7 |
8 GEN_INCLUDE(['../../testing/mock_tts.js']); | 8 GEN_INCLUDE(['../../testing/mock_tts.js']); |
9 | 9 |
10 /** | 10 /** |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 this.runWithDocument(this.formsDoc, function(tabId) { | 170 this.runWithDocument(this.formsDoc, function(tabId) { |
171 var sendDownToSelect = | 171 var sendDownToSelect = |
172 this.sendKeyToElement.bind(this, tabId, 'Down', '#fruitSelect'); | 172 this.sendKeyToElement.bind(this, tabId, 'Down', '#fruitSelect'); |
173 var expect = cvox.ChromeVox.tts.expectSpeech.bind(cvox.ChromeVox.tts); | 173 var expect = cvox.ChromeVox.tts.expectSpeech.bind(cvox.ChromeVox.tts); |
174 expect('apple Menu item 1 of 3 ', sendDownToSelect, true); | 174 expect('apple Menu item 1 of 3 ', sendDownToSelect, true); |
175 expect('grape 2 of 3 ', sendDownToSelect, true); | 175 expect('grape 2 of 3 ', sendDownToSelect, true); |
176 expect('banana 3 of 3 ', testDone, true); | 176 expect('banana 3 of 3 ', testDone, true); |
177 cvox.ChromeVox.tts.finishExpectations(); | 177 cvox.ChromeVox.tts.finishExpectations(); |
178 }.bind(this)); | 178 }.bind(this)); |
179 }); | 179 }); |
| 180 |
| 181 TEST_F('BackgroundTest', 'ContinuousRead', function() { |
| 182 cvox.ChromeVox.tts.expectSpeech('start', null, true); |
| 183 this.runWithDocument(this.linksAndHeadingsDoc, function() { |
| 184 var doCmd = this.doCmd.bind(this); |
| 185 var expect = |
| 186 cvox.ChromeVox.tts.expectSpeechAfter.bind(cvox.ChromeVox.tts); |
| 187 var sendEndEvent = function() { |
| 188 window.setTimeout(function() { |
| 189 this.sendEndEvent(); |
| 190 }.bind(this), 0); |
| 191 }.bind(cvox.ChromeVox.tts); |
| 192 |
| 193 expect('start', doCmd('continuousRead')); |
| 194 expect('alpha Link', sendEndEvent); |
| 195 expect('beta Link', sendEndEvent); |
| 196 expect('Heading charlie', sendEndEvent); |
| 197 cvox.ChromeVox.tts.finishExpectations(); |
| 198 }.bind(this)); |
| 199 }); |
OLD | NEW |