Index: chrome/browser/resources/chromeos/chromevox/testing/mock_feedback_test.unitjs |
diff --git a/chrome/browser/resources/chromeos/chromevox/testing/mock_feedback_test.unitjs b/chrome/browser/resources/chromeos/chromevox/testing/mock_feedback_test.unitjs |
index 77c82201bb02e715d35e028f4b55e43032a56c1f..5466b7739adeb8df1d29b692c328df45328afbc6 100644 |
--- a/chrome/browser/resources/chromeos/chromevox/testing/mock_feedback_test.unitjs |
+++ b/chrome/browser/resources/chromeos/chromevox/testing/mock_feedback_test.unitjs |
@@ -4,7 +4,7 @@ |
// Include test fixture. |
GEN_INCLUDE(['chromevox_unittest_base.js', |
- 'mock_feedback.js']); |
+ 'mock_feedback.js']); |
function speak(text, opt_properties) { |
cvox.ChromeVox.tts.speak(text, 0, opt_properties); |
@@ -16,6 +16,10 @@ function braille(text) { |
return navBraille; |
} |
+function earcon(earconName) { |
+ cvox.ChromeVox.earcons.playEarcon(cvox.Earcon[earconName]); |
+} |
+ |
/** |
* Test fixture. |
* @constructor |
@@ -36,7 +40,8 @@ MockFeedbackUnitTest.prototype = { |
closureModuleDeps: [ |
'cvox.BrailleInterface', |
'cvox.NavBraille', |
- 'cvox.TtsInterface' |
+ 'cvox.TtsInterface', |
+ 'cvox.AbstractEarcons' |
] |
}; |
@@ -170,3 +175,27 @@ TEST_F('MockFeedbackUnitTest', 'NoMatchDoesNotFinish', function() { |
.replay(); |
assertTrue(firstCallbackCalled); |
}); |
+ |
+TEST_F('MockFeedbackUnitTest', 'SpeechAndEarcons', function() { |
+ var finishCalled = false; |
+ var mock = new MockFeedback(function() { finishCalled = true; }); |
+ mock.install(); |
+ mock.call(function() { |
+ speak('MyButton', {startCallback: function() { |
+ earcon('BUTTON'); |
+ }}); |
+ }) |
+ .expectSpeech('MyButton') |
+ .expectEarcon(cvox.Earcon.BUTTON) |
+ .call(function() { |
+ earcon('ALERT_MODAL'); |
+ speak('MyTextField', {startCallback: function() { |
+ earcon('EDITABLE_TEXT'); |
+ }}); |
+ }) |
+ .expectEarcon(cvox.Earcon.ALERT_MODAL) |
+ .expectSpeech('MyTextField') |
+ .expectEarcon(cvox.Earcon.EDITABLE_TEXT) |
+ .replay(); |
+ assertTrue(finishCalled); |
+}); |