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

Unified Diff: chrome/browser/chromeos/accessibility/spoken_feedback_browsertest.cc

Issue 175593003: Add test to make sure ChromeVox speaks when we type in the omnibox. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/accessibility/spoken_feedback_browsertest.cc
diff --git a/chrome/browser/chromeos/accessibility/spoken_feedback_browsertest.cc b/chrome/browser/chromeos/accessibility/spoken_feedback_browsertest.cc
index b529c9b3b9ca5d130e6abeaac4f4752e16135f3e..174360a3683510246e10c029e403af3fb6d8327e 100644
--- a/chrome/browser/chromeos/accessibility/spoken_feedback_browsertest.cc
+++ b/chrome/browser/chromeos/accessibility/spoken_feedback_browsertest.cc
@@ -4,6 +4,7 @@
#include <queue>
+#include "ash/shell.h"
#include "base/command_line.h"
#include "base/strings/string_util.h"
#include "chrome/app/chrome_command_ids.h"
@@ -80,6 +81,35 @@ IN_PROC_BROWSER_TEST_F(SpokenFeedbackTest, FocusToolbar) {
EXPECT_EQ("button", monitor.GetNextUtterance());
}
+IN_PROC_BROWSER_TEST_F(SpokenFeedbackTest, TypeInOmnibox) {
+ EXPECT_FALSE(AccessibilityManager::Get()->IsSpokenFeedbackEnabled());
+
+ SpeechMonitor monitor;
+ AccessibilityManager::Get()->EnableSpokenFeedback(
+ true, ash::A11Y_NOTIFICATION_NONE);
+ EXPECT_TRUE(monitor.SkipChromeVoxEnabledMessage());
+
+ chrome::ExecuteCommand(browser(), IDC_FOCUS_LOCATION);
+
+ gfx::NativeWindow window = ash::Shell::GetInstance()->GetPrimaryRootWindow();
+ ui_controls::SendKeyPress(window, ui::VKEY_X, false, false, false, false);
+ while (true) {
+ std::string utterance = monitor.GetNextUtterance();
+ VLOG(0) << "Got utterance: " << utterance;
+ if (utterance == "x")
+ break;
+ }
+
+ ui_controls::SendKeyPress(window, ui::VKEY_Y, false, false, false, false);
+ EXPECT_EQ("y", monitor.GetNextUtterance());
+
+ ui_controls::SendKeyPress(window, ui::VKEY_Z, false, false, false, false);
+ EXPECT_EQ("z", monitor.GetNextUtterance());
+
+ ui_controls::SendKeyPress(window, ui::VKEY_BACK, false, false, false, false);
+ EXPECT_EQ("z", monitor.GetNextUtterance());
+}
+
//
// Spoken feedback tests of the out-of-box experience.
//
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698