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

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

Issue 595633002: Port event watcher ChromeVox tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@live_regions
Patch Set: 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/chromevox_tests.gypi ('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/chromevox_unittest_base.js
diff --git a/chrome/browser/resources/chromeos/chromevox/testing/chromevox_unittest_base.js b/chrome/browser/resources/chromeos/chromevox/testing/chromevox_unittest_base.js
index 0e598a0a57bd8ee0448309584cc091324108e947..227f34cbde003bc8a54ab8e948d82bae0821d498 100644
--- a/chrome/browser/resources/chromeos/chromevox/testing/chromevox_unittest_base.js
+++ b/chrome/browser/resources/chromeos/chromevox/testing/chromevox_unittest_base.js
@@ -141,6 +141,18 @@ ChromeVoxUnitTestBase.prototype = {
},
/**
+ * Asserts the TTS engine spoken a certain string. Clears the TTS buffer.
Peter Lundblad 2014/09/23 09:40:01 nit: grammar seems odd to this non-native speaker.
dmazzoni 2014/09/23 18:02:41 Done.
+ * @param {string} expectedText The expected text.
+ * @return {cvox.TestCaseClass} this.
Peter Lundblad 2014/09/23 09:40:01 nit: Type should be ChromeVoxUnitTestBase.
dmazzoni 2014/09/23 18:02:40 Done.
+ */
+ assertSpoken: function(expectedText) {
+ assertEquals(expectedText,
+ cvox.ChromeVoxTester.testTts().getUtterancesAsString());
+ cvox.ChromeVoxTester.clearUtterances();
+ return this; // for chaining.
+ },
+
+ /**
* Asserts a list of utterances are in the correct queue mode.
* @param {cvox.SpokenListBuilder|Array} expectedList A list
* of [text, queueMode] tuples OR a SpokenListBuilder with the expected
@@ -167,5 +179,32 @@ ChromeVoxUnitTestBase.prototype = {
expectedText, expectedQueueMode, text, queueMode) {
assertEquals(expectedQueueMode, queueMode);
assertEquals(expectedText, text);
+ },
+
+ /**
+ * Focuses an element.
+ * @param {string} eltName The name of the element to focus.
Peter Lundblad 2014/09/23 09:40:01 Shouldn't this be the id of the element, not the n
dmazzoni 2014/09/23 18:02:40 Done.
+ * @return {ChromeVoxUnitTestBase} this.
+ */
+ setFocus: function(eltName) {
+ $(eltName).focus();
+ return this; // for chaining.
+ },
+
+ /**
+ * Executes a ChromeVox user command.
+ * @param {string} command The name of the command to run.
+ * @return {ChromeVoxUnitTestBase} this.
+ */
+ userCommand: function(command) {
+ cvox.ChromeVoxUserCommands.commands[command]();
Peter Lundblad 2014/09/23 09:40:00 You should add cvox.ChromeVoxUserCommands to the c
dmazzoni 2014/09/23 18:02:41 Done.
+ return this; // for chaining.
+ },
+
+ /**
+ * @return {cvox.SpokenListBuilder} A new builder.
+ */
+ spokenList: function() {
Peter Lundblad 2014/09/23 09:40:00 This also has an undeclared dependency, but I'd ju
dmazzoni 2014/09/23 18:02:41 It's useful for chaining and will make porting oth
+ return new cvox.SpokenListBuilder();
}
};
« no previous file with comments | « chrome/browser/resources/chromeos/chromevox/chromevox_tests.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698