Commit 4cb9100c authored by dmazzoni@chromium.org's avatar dmazzoni@chromium.org

Add test to make sure ChromeVox speaks when we type in the omnibox.

BUG=339902
R=plundblad@chromium.org

Review URL: https://codereview.chromium.org/175593003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@252885 0039d316-1c4b-4281-b951-d872f2087c98
parent 6227e317
......@@ -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.
//
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment