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

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

Issue 582123002: Port live region ChromeVox tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@chromevox_keyboard_tests_again
Patch Set: Improve comments in chromevox_unittest_base Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/resources/chromeos/chromevox/testing/chromevox_unittest_base.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/chromeos/chromevox/testing/spoken_list_builder.js
diff --git a/chrome/browser/resources/chromeos/chromevox/testing/spoken_list_builder.js b/chrome/browser/resources/chromeos/chromevox/testing/spoken_list_builder.js
new file mode 100644
index 0000000000000000000000000000000000000000..56a7ec0b842f103e92ff1f812f751c80a12642e2
--- /dev/null
+++ b/chrome/browser/resources/chromeos/chromevox/testing/spoken_list_builder.js
@@ -0,0 +1,61 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+/**
+ * @fileoverview The spoken list builder. Used in test cases.
+ */
+
+goog.provide('cvox.SpokenListBuilder');
+
+
+
+/**
+ * Builds a spoken list.
+ * @constructor
+ */
+cvox.SpokenListBuilder = function() {
+ this.list_ = [];
+};
+
+
+/**
+ * Adds an expected flushed utterance to the builder.
+ * @param {string} expectedText The expected text.
+ * @return {cvox.SpokenListBuilder} this.
+ */
+cvox.SpokenListBuilder.prototype.flush = function(expectedText) {
+ this.list_.push([expectedText, cvox.AbstractTts.QUEUE_MODE_FLUSH]);
+ return this; // for chaining
+};
+
+
+/**
+ * Adds an expected queued utterance to the builder.
+ * @param {string} expectedText The expected text.
+ * @return {cvox.SpokenListBuilder} this.
+ */
+cvox.SpokenListBuilder.prototype.queue = function(expectedText) {
+ this.list_.push([expectedText, cvox.AbstractTts.QUEUE_MODE_QUEUE]);
+ return this; // for chaining
+};
+
+
+/**
+ * Adds an expected category-flush utterance to the builder.
+ * @param {string} expectedText The expected text.
+ * @return {cvox.SpokenListBuilder} this.
+ */
+cvox.SpokenListBuilder.prototype.categoryFlush = function(expectedText) {
+ this.list_.push([expectedText, cvox.AbstractTts.QUEUE_MODE_CATEGORY_FLUSH]);
+ return this; // for chaining
+};
+
+
+/**
+ * Builds the list.
+ * @return {Array} The array of utterances.
+ */
+cvox.SpokenListBuilder.prototype.build = function() {
+ return this.list_;
+};
« no previous file with comments | « chrome/browser/resources/chromeos/chromevox/testing/chromevox_unittest_base.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698