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 "ash/system/tray/system_tray.h" | 8 #include "ash/system/tray/system_tray.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 | 45 |
46 // | 46 // |
47 // Spoken feedback tests only in a logged in user's window. | 47 // Spoken feedback tests only in a logged in user's window. |
48 // | 48 // |
49 | 49 |
50 class LoggedInSpokenFeedbackTest : public InProcessBrowserTest { | 50 class LoggedInSpokenFeedbackTest : public InProcessBrowserTest { |
51 protected: | 51 protected: |
52 LoggedInSpokenFeedbackTest() {} | 52 LoggedInSpokenFeedbackTest() {} |
53 virtual ~LoggedInSpokenFeedbackTest() {} | 53 virtual ~LoggedInSpokenFeedbackTest() {} |
54 | 54 |
55 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { | 55 virtual void SetUpInProcessBrowserTestFixture() override { |
56 AccessibilityManager::SetBrailleControllerForTest(&braille_controller_); | 56 AccessibilityManager::SetBrailleControllerForTest(&braille_controller_); |
57 } | 57 } |
58 | 58 |
59 virtual void TearDownOnMainThread() OVERRIDE { | 59 virtual void TearDownOnMainThread() override { |
60 AccessibilityManager::SetBrailleControllerForTest(NULL); | 60 AccessibilityManager::SetBrailleControllerForTest(NULL); |
61 } | 61 } |
62 | 62 |
63 void SendKeyPress(ui::KeyboardCode key) { | 63 void SendKeyPress(ui::KeyboardCode key) { |
64 ASSERT_NO_FATAL_FAILURE( | 64 ASSERT_NO_FATAL_FAILURE( |
65 ASSERT_TRUE( | 65 ASSERT_TRUE( |
66 ui_test_utils::SendKeyPressToWindowSync( | 66 ui_test_utils::SendKeyPressToWindowSync( |
67 NULL, key, false, false, false, false))); | 67 NULL, key, false, false, false, false))); |
68 } | 68 } |
69 | 69 |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 kTestAsGuestUser | 216 kTestAsGuestUser |
217 }; | 217 }; |
218 | 218 |
219 class SpokenFeedbackTest | 219 class SpokenFeedbackTest |
220 : public LoggedInSpokenFeedbackTest, | 220 : public LoggedInSpokenFeedbackTest, |
221 public ::testing::WithParamInterface<SpokenFeedbackTestVariant> { | 221 public ::testing::WithParamInterface<SpokenFeedbackTestVariant> { |
222 protected: | 222 protected: |
223 SpokenFeedbackTest() {} | 223 SpokenFeedbackTest() {} |
224 virtual ~SpokenFeedbackTest() {} | 224 virtual ~SpokenFeedbackTest() {} |
225 | 225 |
226 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 226 virtual void SetUpCommandLine(CommandLine* command_line) override { |
227 if (GetParam() == kTestAsGuestUser) { | 227 if (GetParam() == kTestAsGuestUser) { |
228 command_line->AppendSwitch(chromeos::switches::kGuestSession); | 228 command_line->AppendSwitch(chromeos::switches::kGuestSession); |
229 command_line->AppendSwitch(::switches::kIncognito); | 229 command_line->AppendSwitch(::switches::kIncognito); |
230 command_line->AppendSwitchASCII(chromeos::switches::kLoginProfile, | 230 command_line->AppendSwitchASCII(chromeos::switches::kLoginProfile, |
231 "user"); | 231 "user"); |
232 command_line->AppendSwitchASCII(chromeos::switches::kLoginUser, | 232 command_line->AppendSwitchASCII(chromeos::switches::kLoginUser, |
233 chromeos::login::kGuestUserName); | 233 chromeos::login::kGuestUserName); |
234 } | 234 } |
235 } | 235 } |
236 }; | 236 }; |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
423 | 423 |
424 // | 424 // |
425 // Spoken feedback tests that run only in guest mode. | 425 // Spoken feedback tests that run only in guest mode. |
426 // | 426 // |
427 | 427 |
428 class GuestSpokenFeedbackTest : public LoggedInSpokenFeedbackTest { | 428 class GuestSpokenFeedbackTest : public LoggedInSpokenFeedbackTest { |
429 protected: | 429 protected: |
430 GuestSpokenFeedbackTest() {} | 430 GuestSpokenFeedbackTest() {} |
431 virtual ~GuestSpokenFeedbackTest() {} | 431 virtual ~GuestSpokenFeedbackTest() {} |
432 | 432 |
433 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 433 virtual void SetUpCommandLine(CommandLine* command_line) override { |
434 command_line->AppendSwitch(chromeos::switches::kGuestSession); | 434 command_line->AppendSwitch(chromeos::switches::kGuestSession); |
435 command_line->AppendSwitch(::switches::kIncognito); | 435 command_line->AppendSwitch(::switches::kIncognito); |
436 command_line->AppendSwitchASCII(chromeos::switches::kLoginProfile, "user"); | 436 command_line->AppendSwitchASCII(chromeos::switches::kLoginProfile, "user"); |
437 command_line->AppendSwitchASCII(chromeos::switches::kLoginUser, | 437 command_line->AppendSwitchASCII(chromeos::switches::kLoginUser, |
438 chromeos::login::kGuestUserName); | 438 chromeos::login::kGuestUserName); |
439 } | 439 } |
440 | 440 |
441 private: | 441 private: |
442 DISALLOW_COPY_AND_ASSIGN(GuestSpokenFeedbackTest); | 442 DISALLOW_COPY_AND_ASSIGN(GuestSpokenFeedbackTest); |
443 }; | 443 }; |
(...skipping 15 matching lines...) Expand all Loading... |
459 | 459 |
460 // | 460 // |
461 // Spoken feedback tests of the out-of-box experience. | 461 // Spoken feedback tests of the out-of-box experience. |
462 // | 462 // |
463 | 463 |
464 class OobeSpokenFeedbackTest : public InProcessBrowserTest { | 464 class OobeSpokenFeedbackTest : public InProcessBrowserTest { |
465 protected: | 465 protected: |
466 OobeSpokenFeedbackTest() {} | 466 OobeSpokenFeedbackTest() {} |
467 virtual ~OobeSpokenFeedbackTest() {} | 467 virtual ~OobeSpokenFeedbackTest() {} |
468 | 468 |
469 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 469 virtual void SetUpCommandLine(CommandLine* command_line) override { |
470 command_line->AppendSwitch(chromeos::switches::kLoginManager); | 470 command_line->AppendSwitch(chromeos::switches::kLoginManager); |
471 command_line->AppendSwitch(chromeos::switches::kForceLoginManagerInTests); | 471 command_line->AppendSwitch(chromeos::switches::kForceLoginManagerInTests); |
472 command_line->AppendSwitchASCII(chromeos::switches::kLoginProfile, "user"); | 472 command_line->AppendSwitchASCII(chromeos::switches::kLoginProfile, "user"); |
473 } | 473 } |
474 | 474 |
475 virtual void SetUpOnMainThread() OVERRIDE { | 475 virtual void SetUpOnMainThread() override { |
476 AccessibilityManager::Get()-> | 476 AccessibilityManager::Get()-> |
477 SetProfileForTest(ProfileHelper::GetSigninProfile()); | 477 SetProfileForTest(ProfileHelper::GetSigninProfile()); |
478 } | 478 } |
479 | 479 |
480 SpeechMonitor speech_monitor_; | 480 SpeechMonitor speech_monitor_; |
481 | 481 |
482 private: | 482 private: |
483 DISALLOW_COPY_AND_ASSIGN(OobeSpokenFeedbackTest); | 483 DISALLOW_COPY_AND_ASSIGN(OobeSpokenFeedbackTest); |
484 }; | 484 }; |
485 | 485 |
(...skipping 15 matching lines...) Expand all Loading... |
501 EXPECT_EQ("English ( United States)", speech_monitor_.GetNextUtterance()); | 501 EXPECT_EQ("English ( United States)", speech_monitor_.GetNextUtterance()); |
502 EXPECT_TRUE(MatchPattern(speech_monitor_.GetNextUtterance(), | 502 EXPECT_TRUE(MatchPattern(speech_monitor_.GetNextUtterance(), |
503 "Combo box * of *")); | 503 "Combo box * of *")); |
504 ASSERT_TRUE( | 504 ASSERT_TRUE( |
505 ui_test_utils::SendKeyPressToWindowSync( | 505 ui_test_utils::SendKeyPressToWindowSync( |
506 window, ui::VKEY_TAB, false, false, false, false)); | 506 window, ui::VKEY_TAB, false, false, false, false)); |
507 EXPECT_EQ("Select your keyboard:", speech_monitor_.GetNextUtterance()); | 507 EXPECT_EQ("Select your keyboard:", speech_monitor_.GetNextUtterance()); |
508 } | 508 } |
509 | 509 |
510 } // namespace chromeos | 510 } // namespace chromeos |
OLD | NEW |