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

Side by Side Diff: chrome/browser/resources/chromeos/chromevox/testing/spoken_list_builder.js

Issue 604423002: Use an enum for ChromeVox queue mode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 2 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 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 The spoken list builder. Used in test cases. 6 * @fileoverview The spoken list builder. Used in test cases.
7 */ 7 */
8 8
9 goog.provide('cvox.SpokenListBuilder'); 9 goog.provide('cvox.SpokenListBuilder');
10 10 goog.require('cvox.QueueMode');
11 11
12 12
13 /** 13 /**
14 * Builds a spoken list. 14 * Builds a spoken list.
15 * @constructor 15 * @constructor
16 */ 16 */
17 cvox.SpokenListBuilder = function() { 17 cvox.SpokenListBuilder = function() {
18 this.list_ = []; 18 this.list_ = [];
19 }; 19 };
20 20
21 21
22 /** 22 /**
23 * Adds an expected flushed utterance to the builder. 23 * Adds an expected flushed utterance to the builder.
24 * @param {string} expectedText The expected text. 24 * @param {string} expectedText The expected text.
25 * @return {cvox.SpokenListBuilder} this. 25 * @return {cvox.SpokenListBuilder} this.
26 */ 26 */
27 cvox.SpokenListBuilder.prototype.flush = function(expectedText) { 27 cvox.SpokenListBuilder.prototype.flush = function(expectedText) {
28 this.list_.push([expectedText, cvox.AbstractTts.QUEUE_MODE_FLUSH]); 28 this.list_.push([expectedText, cvox.QueueMode.FLUSH]);
29 return this; // for chaining 29 return this; // for chaining
30 }; 30 };
31 31
32 32
33 /** 33 /**
34 * Adds an expected queued utterance to the builder. 34 * Adds an expected queued utterance to the builder.
35 * @param {string} expectedText The expected text. 35 * @param {string} expectedText The expected text.
36 * @return {cvox.SpokenListBuilder} this. 36 * @return {cvox.SpokenListBuilder} this.
37 */ 37 */
38 cvox.SpokenListBuilder.prototype.queue = function(expectedText) { 38 cvox.SpokenListBuilder.prototype.queue = function(expectedText) {
39 this.list_.push([expectedText, cvox.AbstractTts.QUEUE_MODE_QUEUE]); 39 this.list_.push([expectedText, cvox.QueueMode.QUEUE]);
40 return this; // for chaining 40 return this; // for chaining
41 }; 41 };
42 42
43 43
44 /** 44 /**
45 * Adds an expected category-flush utterance to the builder. 45 * Adds an expected category-flush utterance to the builder.
46 * @param {string} expectedText The expected text. 46 * @param {string} expectedText The expected text.
47 * @return {cvox.SpokenListBuilder} this. 47 * @return {cvox.SpokenListBuilder} this.
48 */ 48 */
49 cvox.SpokenListBuilder.prototype.categoryFlush = function(expectedText) { 49 cvox.SpokenListBuilder.prototype.categoryFlush = function(expectedText) {
50 this.list_.push([expectedText, cvox.AbstractTts.QUEUE_MODE_CATEGORY_FLUSH]); 50 this.list_.push([expectedText, cvox.QueueMode.CATEGORY_FLUSH]);
51 return this; // for chaining 51 return this; // for chaining
52 }; 52 };
53 53
54 54
55 /** 55 /**
56 * Builds the list. 56 * Builds the list.
57 * @return {Array} The array of utterances. 57 * @return {Array} The array of utterances.
58 */ 58 */
59 cvox.SpokenListBuilder.prototype.build = function() { 59 cvox.SpokenListBuilder.prototype.build = function() {
60 return this.list_; 60 return this.list_;
61 }; 61 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698