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(); |
} |
}; |