| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 /** | 5 /** |
| 6 * @fileoverview This file contains the |MockFeedback| class which is | 6 * @fileoverview This file contains the |MockFeedback| class which is |
| 7 * a combined mock class for speech, braille, and earcon feedback. A | 7 * a combined mock class for speech, braille, and earcon feedback. A |
| 8 * test that uses this class may add expectations for speech | 8 * test that uses this class may add expectations for speech |
| 9 * utterances, braille display content to be output, and earcons | 9 * utterances, braille display content to be output, and earcons |
| 10 * played (by name). The |install| method sets appropriate mock | 10 * played (by name). The |install| method sets appropriate mock |
| (...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 330 return this.lastMatchedBraille_; | 330 return this.lastMatchedBraille_; |
| 331 }, | 331 }, |
| 332 | 332 |
| 333 /** | 333 /** |
| 334 * @param {string} textString | 334 * @param {string} textString |
| 335 * @param {cvox.QueueMode} queueMode | 335 * @param {cvox.QueueMode} queueMode |
| 336 * @param {Object=} properties | 336 * @param {Object=} properties |
| 337 * @private | 337 * @private |
| 338 */ | 338 */ |
| 339 addUtterance_: function(textString, queueMode, properties) { | 339 addUtterance_: function(textString, queueMode, properties) { |
| 340 console.log('speak!'+textString); |
| 340 var callback; | 341 var callback; |
| 341 if (properties && (properties.startCallback || properties.endCallback)) { | 342 if (properties && (properties.startCallback || properties.endCallback)) { |
| 342 var startCallback = properties.startCallback; | 343 var startCallback = properties.startCallback; |
| 343 var endCallback = properties.endCallback; | 344 var endCallback = properties.endCallback; |
| 344 callback = function() { | 345 callback = function() { |
| 345 startCallback && startCallback(); | 346 startCallback && startCallback(); |
| 346 endCallback && endCallback(); | 347 endCallback && endCallback(); |
| 347 }; | 348 }; |
| 348 } | 349 } |
| 349 this.pendingUtterances_.push( | 350 this.pendingUtterances_.push( |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 453 } | 454 } |
| 454 if (candidate) { | 455 if (candidate) { |
| 455 var consumed = pending.splice(0, i + 1); | 456 var consumed = pending.splice(0, i + 1); |
| 456 consumed.forEach(function(item) { | 457 consumed.forEach(function(item) { |
| 457 if (item.callback) | 458 if (item.callback) |
| 458 item.callback(); | 459 item.callback(); |
| 459 }); | 460 }); |
| 460 } | 461 } |
| 461 return candidate; | 462 return candidate; |
| 462 }; | 463 }; |
| OLD | NEW |