Only grant permissions to new extensions from sync if they have the expected version
[chromium-blink-merge.git] / chrome / browser / resources / chromeos / chromevox / testing / spoken_list_builder.js
blob64bc467882e83790790cf47bd26c53dc13134979
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.
5 /**
6 * @fileoverview The spoken list builder. Used in test cases.
7 */
9 goog.provide('cvox.SpokenListBuilder');
10 goog.require('cvox.QueueMode');
13 /**
14 * Builds a spoken list.
15 * @constructor
17 cvox.SpokenListBuilder = function() {
18 this.list_ = [];
22 /**
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
33 /**
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
44 /**
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
55 /**
56 * Builds the list.
57 * @return {Array} The array of utterances.
59 cvox.SpokenListBuilder.prototype.build = function() {
60 return this.list_;