OLD | NEW |
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" |
11 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" | 11 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" |
12 #include "chrome/browser/chromeos/accessibility/speech_monitor.h" | 12 #include "chrome/browser/chromeos/accessibility/speech_monitor.h" |
13 #include "chrome/browser/chromeos/login/ui/login_display_host.h" | 13 #include "chrome/browser/chromeos/login/ui/login_display_host.h" |
14 #include "chrome/browser/chromeos/login/ui/login_display_host_impl.h" | 14 #include "chrome/browser/chromeos/login/ui/login_display_host_impl.h" |
15 #include "chrome/browser/chromeos/login/ui/webui_login_view.h" | 15 #include "chrome/browser/chromeos/login/ui/webui_login_view.h" |
16 #include "chrome/browser/chromeos/login/users/user_manager.h" | |
17 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 16 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
18 #include "chrome/browser/extensions/api/braille_display_private/stub_braille_con
troller.h" | 17 #include "chrome/browser/extensions/api/braille_display_private/stub_braille_con
troller.h" |
19 #include "chrome/browser/speech/tts_controller.h" | 18 #include "chrome/browser/speech/tts_controller.h" |
20 #include "chrome/browser/speech/tts_platform.h" | 19 #include "chrome/browser/speech/tts_platform.h" |
21 #include "chrome/browser/ui/browser.h" | 20 #include "chrome/browser/ui/browser.h" |
22 #include "chrome/browser/ui/browser_commands.h" | 21 #include "chrome/browser/ui/browser_commands.h" |
23 #include "chrome/browser/ui/browser_window.h" | 22 #include "chrome/browser/ui/browser_window.h" |
24 #include "chrome/common/chrome_switches.h" | 23 #include "chrome/common/chrome_switches.h" |
25 #include "chrome/test/base/in_process_browser_test.h" | 24 #include "chrome/test/base/in_process_browser_test.h" |
26 #include "chrome/test/base/interactive_test_utils.h" | 25 #include "chrome/test/base/interactive_test_utils.h" |
27 #include "chrome/test/base/testing_profile.h" | 26 #include "chrome/test/base/testing_profile.h" |
28 #include "chrome/test/base/ui_test_utils.h" | 27 #include "chrome/test/base/ui_test_utils.h" |
29 #include "chromeos/chromeos_switches.h" | 28 #include "chromeos/chromeos_switches.h" |
| 29 #include "chromeos/login/user_names.h" |
30 #include "content/public/common/url_constants.h" | 30 #include "content/public/common/url_constants.h" |
31 #include "content/public/test/test_utils.h" | 31 #include "content/public/test/test_utils.h" |
32 #include "testing/gtest/include/gtest/gtest.h" | 32 #include "testing/gtest/include/gtest/gtest.h" |
33 #include "ui/base/test/ui_controls.h" | 33 #include "ui/base/test/ui_controls.h" |
34 #include "ui/views/widget/widget.h" | 34 #include "ui/views/widget/widget.h" |
35 | 35 |
36 using extensions::api::braille_display_private::StubBrailleController; | 36 using extensions::api::braille_display_private::StubBrailleController; |
37 | 37 |
38 namespace chromeos { | 38 namespace chromeos { |
39 | 39 |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 SpokenFeedbackTest() {} | 133 SpokenFeedbackTest() {} |
134 virtual ~SpokenFeedbackTest() {} | 134 virtual ~SpokenFeedbackTest() {} |
135 | 135 |
136 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 136 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
137 if (GetParam() == kTestAsGuestUser) { | 137 if (GetParam() == kTestAsGuestUser) { |
138 command_line->AppendSwitch(chromeos::switches::kGuestSession); | 138 command_line->AppendSwitch(chromeos::switches::kGuestSession); |
139 command_line->AppendSwitch(::switches::kIncognito); | 139 command_line->AppendSwitch(::switches::kIncognito); |
140 command_line->AppendSwitchASCII(chromeos::switches::kLoginProfile, | 140 command_line->AppendSwitchASCII(chromeos::switches::kLoginProfile, |
141 "user"); | 141 "user"); |
142 command_line->AppendSwitchASCII(chromeos::switches::kLoginUser, | 142 command_line->AppendSwitchASCII(chromeos::switches::kLoginUser, |
143 chromeos::UserManager::kGuestUserName); | 143 chromeos::login::kGuestUserName); |
144 } | 144 } |
145 } | 145 } |
146 }; | 146 }; |
147 | 147 |
148 INSTANTIATE_TEST_CASE_P( | 148 INSTANTIATE_TEST_CASE_P( |
149 TestAsNormalAndGuestUser, | 149 TestAsNormalAndGuestUser, |
150 SpokenFeedbackTest, | 150 SpokenFeedbackTest, |
151 ::testing::Values(kTestAsNormalUser, | 151 ::testing::Values(kTestAsNormalUser, |
152 kTestAsGuestUser)); | 152 kTestAsGuestUser)); |
153 | 153 |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 class GuestSpokenFeedbackTest : public LoggedInSpokenFeedbackTest { | 212 class GuestSpokenFeedbackTest : public LoggedInSpokenFeedbackTest { |
213 protected: | 213 protected: |
214 GuestSpokenFeedbackTest() {} | 214 GuestSpokenFeedbackTest() {} |
215 virtual ~GuestSpokenFeedbackTest() {} | 215 virtual ~GuestSpokenFeedbackTest() {} |
216 | 216 |
217 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 217 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
218 command_line->AppendSwitch(chromeos::switches::kGuestSession); | 218 command_line->AppendSwitch(chromeos::switches::kGuestSession); |
219 command_line->AppendSwitch(::switches::kIncognito); | 219 command_line->AppendSwitch(::switches::kIncognito); |
220 command_line->AppendSwitchASCII(chromeos::switches::kLoginProfile, "user"); | 220 command_line->AppendSwitchASCII(chromeos::switches::kLoginProfile, "user"); |
221 command_line->AppendSwitchASCII(chromeos::switches::kLoginUser, | 221 command_line->AppendSwitchASCII(chromeos::switches::kLoginUser, |
222 chromeos::UserManager::kGuestUserName); | 222 chromeos::login::kGuestUserName); |
223 } | 223 } |
224 | 224 |
225 private: | 225 private: |
226 DISALLOW_COPY_AND_ASSIGN(GuestSpokenFeedbackTest); | 226 DISALLOW_COPY_AND_ASSIGN(GuestSpokenFeedbackTest); |
227 }; | 227 }; |
228 | 228 |
229 IN_PROC_BROWSER_TEST_F(GuestSpokenFeedbackTest, FocusToolbar) { | 229 IN_PROC_BROWSER_TEST_F(GuestSpokenFeedbackTest, FocusToolbar) { |
230 EXPECT_FALSE(AccessibilityManager::Get()->IsSpokenFeedbackEnabled()); | 230 EXPECT_FALSE(AccessibilityManager::Get()->IsSpokenFeedbackEnabled()); |
231 | 231 |
232 SpeechMonitor monitor; | 232 SpeechMonitor monitor; |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
283 EXPECT_EQ("Select your language:", monitor.GetNextUtterance()); | 283 EXPECT_EQ("Select your language:", monitor.GetNextUtterance()); |
284 EXPECT_EQ("English ( United States)", monitor.GetNextUtterance()); | 284 EXPECT_EQ("English ( United States)", monitor.GetNextUtterance()); |
285 EXPECT_TRUE(MatchPattern(monitor.GetNextUtterance(), "Combo box * of *")); | 285 EXPECT_TRUE(MatchPattern(monitor.GetNextUtterance(), "Combo box * of *")); |
286 ASSERT_TRUE( | 286 ASSERT_TRUE( |
287 ui_test_utils::SendKeyPressToWindowSync( | 287 ui_test_utils::SendKeyPressToWindowSync( |
288 window, ui::VKEY_TAB, false, false, false, false)); | 288 window, ui::VKEY_TAB, false, false, false, false)); |
289 EXPECT_EQ("Select your keyboard:", monitor.GetNextUtterance()); | 289 EXPECT_EQ("Select your keyboard:", monitor.GetNextUtterance()); |
290 } | 290 } |
291 | 291 |
292 } // namespace chromeos | 292 } // namespace chromeos |
OLD | NEW |