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

Side by Side Diff: chrome/browser/chromeos/accessibility/spoken_feedback_browsertest.cc

Issue 268823002: Re-land: Rename experimental.accessibility to accessibilityPrivate (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <queue> 5 #include <queue>
6 6
7 #include "ash/shell.h" 7 #include "ash/shell.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "chrome/app/chrome_command_ids.h" 10 #include "chrome/app/chrome_command_ids.h"
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 EXPECT_EQ("y", monitor.GetNextUtterance()); 129 EXPECT_EQ("y", monitor.GetNextUtterance());
130 130
131 ui_controls::SendKeyPress(window, ui::VKEY_Z, false, false, false, false); 131 ui_controls::SendKeyPress(window, ui::VKEY_Z, false, false, false, false);
132 EXPECT_EQ("z", monitor.GetNextUtterance()); 132 EXPECT_EQ("z", monitor.GetNextUtterance());
133 133
134 ui_controls::SendKeyPress(window, ui::VKEY_BACK, false, false, false, false); 134 ui_controls::SendKeyPress(window, ui::VKEY_BACK, false, false, false, false);
135 EXPECT_EQ("z", monitor.GetNextUtterance()); 135 EXPECT_EQ("z", monitor.GetNextUtterance());
136 } 136 }
137 137
138 // 138 //
139 // Spoken feedback tests that run in guest mode.
140 //
141
142 class GuestSpokenFeedbackTest : public SpokenFeedbackTest {
143 protected:
144 GuestSpokenFeedbackTest() {}
145 virtual ~GuestSpokenFeedbackTest() {}
146
147 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE {
148 command_line->AppendSwitch(chromeos::switches::kGuestSession);
149 command_line->AppendSwitch(::switches::kIncognito);
150 command_line->AppendSwitchASCII(chromeos::switches::kLoginProfile, "user");
151 command_line->AppendSwitchASCII(chromeos::switches::kLoginUser,
152 chromeos::UserManager::kGuestUserName);
153 }
154
155 private:
156 DISALLOW_COPY_AND_ASSIGN(GuestSpokenFeedbackTest);
157 };
158
159 IN_PROC_BROWSER_TEST_F(GuestSpokenFeedbackTest, FocusToolbar) {
160 EXPECT_FALSE(AccessibilityManager::Get()->IsSpokenFeedbackEnabled());
161
162 SpeechMonitor monitor;
163 AccessibilityManager::Get()->EnableSpokenFeedback(
164 true, ash::A11Y_NOTIFICATION_NONE);
165 EXPECT_TRUE(monitor.SkipChromeVoxEnabledMessage());
166
167 chrome::ExecuteCommand(browser(), IDC_FOCUS_TOOLBAR);
168 // Might be "Google Chrome Toolbar" or "Chromium Toolbar".
169 EXPECT_TRUE(MatchPattern(monitor.GetNextUtterance(), "*oolbar*"));
170 EXPECT_EQ("Reload,", monitor.GetNextUtterance());
171 EXPECT_EQ("button", monitor.GetNextUtterance());
172 }
173
174 //
139 // Spoken feedback tests of the out-of-box experience. 175 // Spoken feedback tests of the out-of-box experience.
140 // 176 //
141 177
142 class OobeSpokenFeedbackTest : public InProcessBrowserTest { 178 class OobeSpokenFeedbackTest : public InProcessBrowserTest {
143 protected: 179 protected:
144 OobeSpokenFeedbackTest() {} 180 OobeSpokenFeedbackTest() {}
145 virtual ~OobeSpokenFeedbackTest() {} 181 virtual ~OobeSpokenFeedbackTest() {}
146 182
147 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { 183 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE {
148 command_line->AppendSwitch(chromeos::switches::kLoginManager); 184 command_line->AppendSwitch(chromeos::switches::kLoginManager);
(...skipping 26 matching lines...) Expand all
175 EXPECT_TRUE(monitor.SkipChromeVoxEnabledMessage()); 211 EXPECT_TRUE(monitor.SkipChromeVoxEnabledMessage());
176 212
177 EXPECT_EQ("Select your language:", monitor.GetNextUtterance()); 213 EXPECT_EQ("Select your language:", monitor.GetNextUtterance());
178 EXPECT_EQ("English ( United States)", monitor.GetNextUtterance()); 214 EXPECT_EQ("English ( United States)", monitor.GetNextUtterance());
179 EXPECT_TRUE(MatchPattern(monitor.GetNextUtterance(), "Combo box * of *")); 215 EXPECT_TRUE(MatchPattern(monitor.GetNextUtterance(), "Combo box * of *"));
180 ui_controls::SendKeyPress(window, ui::VKEY_TAB, false, false, false, false); 216 ui_controls::SendKeyPress(window, ui::VKEY_TAB, false, false, false, false);
181 EXPECT_EQ("Select your keyboard:", monitor.GetNextUtterance()); 217 EXPECT_EQ("Select your keyboard:", monitor.GetNextUtterance());
182 } 218 }
183 219
184 } // namespace chromeos 220 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698