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
3 // found in the LICENSE file.
6 * @fileoverview The spoken list builder. Used in test cases.
9 goog
.provide('cvox.SpokenListBuilder');
10 goog
.require('cvox.QueueMode');
14 * Builds a spoken list.
17 cvox
.SpokenListBuilder = function() {
23 * Adds an expected flushed utterance to the builder.
24 * @param {string} expectedText The expected text.
25 * @return {cvox.SpokenListBuilder} this.
27 cvox
.SpokenListBuilder
.prototype.flush = function(expectedText
) {
28 this.list_
.push([expectedText
, cvox
.QueueMode
.FLUSH
]);
29 return this; // for chaining
34 * Adds an expected queued utterance to the builder.
35 * @param {string} expectedText The expected text.
36 * @return {cvox.SpokenListBuilder} this.
38 cvox
.SpokenListBuilder
.prototype.queue = function(expectedText
) {
39 this.list_
.push([expectedText
, cvox
.QueueMode
.QUEUE
]);
40 return this; // for chaining
45 * Adds an expected category-flush utterance to the builder.
46 * @param {string} expectedText The expected text.
47 * @return {cvox.SpokenListBuilder} this.
49 cvox
.SpokenListBuilder
.prototype.categoryFlush = function(expectedText
) {
50 this.list_
.push([expectedText
, cvox
.QueueMode
.CATEGORY_FLUSH
]);
51 return this; // for chaining
57 * @return {Array} The array of utterances.
59 cvox
.SpokenListBuilder
.prototype.build = function() {