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

Unified Diff: chrome/browser/resources/chromeos/chromevox/testing/mock_feedback_test.unitjs

Issue 1319093003: Use new earcons in ChromeVox Next. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@automation_node_id_fix_2
Patch Set: Rebase Created 5 years, 2 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/mock_feedback.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/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);
+});
« no previous file with comments | « chrome/browser/resources/chromeos/chromevox/testing/mock_feedback.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698