OLD | NEW |
---|---|
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "chrome/browser/chromeos/accessibility/accessibility_manager.h" | 5 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" |
6 | 6 |
7 #include "ash/magnifier/magnification_controller.h" | 7 #include "ash/magnifier/magnification_controller.h" |
8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
11 #include "chrome/browser/browser_process.h" | 11 #include "chrome/browser/browser_process.h" |
12 #include "chrome/browser/chrome_notification_types.h" | 12 #include "chrome/browser/chrome_notification_types.h" |
13 #include "chrome/browser/chromeos/accessibility/magnification_manager.h" | 13 #include "chrome/browser/chromeos/accessibility/magnification_manager.h" |
14 #include "chrome/browser/chromeos/login/helper.h" | 14 #include "chrome/browser/chromeos/login/helper.h" |
15 #include "chrome/browser/chromeos/login/login_utils.h" | 15 #include "chrome/browser/chromeos/login/login_utils.h" |
16 #include "chrome/browser/chromeos/login/users/user_manager.h" | |
Nikita (slow)
2014/07/07 21:05:40
This include should be returned back since there'r
Denis Kuznetsov (DE-MUC)
2014/07/08 11:08:28
Done.
| |
17 #include "chrome/browser/chromeos/login/users/user_manager_impl.h" | 16 #include "chrome/browser/chromeos/login/users/user_manager_impl.h" |
18 #include "chrome/browser/chromeos/preferences.h" | 17 #include "chrome/browser/chromeos/preferences.h" |
19 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 18 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
20 #include "chrome/browser/extensions/api/braille_display_private/mock_braille_con troller.h" | 19 #include "chrome/browser/extensions/api/braille_display_private/mock_braille_con troller.h" |
21 #include "chrome/browser/prefs/pref_service_syncable.h" | 20 #include "chrome/browser/prefs/pref_service_syncable.h" |
22 #include "chrome/browser/profiles/profile.h" | 21 #include "chrome/browser/profiles/profile.h" |
23 #include "chrome/browser/profiles/profile_manager.h" | 22 #include "chrome/browser/profiles/profile_manager.h" |
24 #include "chrome/common/extensions/extension_constants.h" | 23 #include "chrome/common/extensions/extension_constants.h" |
25 #include "chrome/common/pref_names.h" | 24 #include "chrome/common/pref_names.h" |
26 #include "chrome/test/base/in_process_browser_test.h" | 25 #include "chrome/test/base/in_process_browser_test.h" |
27 #include "chrome/test/base/testing_profile.h" | 26 #include "chrome/test/base/testing_profile.h" |
28 #include "chromeos/chromeos_switches.h" | 27 #include "chromeos/chromeos_switches.h" |
29 #include "chromeos/ime/component_extension_ime_manager.h" | 28 #include "chromeos/ime/component_extension_ime_manager.h" |
30 #include "chromeos/ime/input_method_manager.h" | 29 #include "chromeos/ime/input_method_manager.h" |
30 #include "chromeos/login/user_names.h" | |
31 #include "content/public/browser/notification_service.h" | 31 #include "content/public/browser/notification_service.h" |
32 #include "content/public/test/test_utils.h" | 32 #include "content/public/test/test_utils.h" |
33 #include "testing/gtest/include/gtest/gtest.h" | 33 #include "testing/gtest/include/gtest/gtest.h" |
34 | 34 |
35 using chromeos::input_method::InputMethodManager; | 35 using chromeos::input_method::InputMethodManager; |
36 using chromeos::input_method::InputMethodUtil; | 36 using chromeos::input_method::InputMethodUtil; |
37 using chromeos::input_method::InputMethodDescriptors; | 37 using chromeos::input_method::InputMethodDescriptors; |
38 using content::BrowserThread; | 38 using content::BrowserThread; |
39 using extensions::api::braille_display_private::BrailleObserver; | 39 using extensions::api::braille_display_private::BrailleObserver; |
40 using extensions::api::braille_display_private::DisplayState; | 40 using extensions::api::braille_display_private::DisplayState; |
41 using extensions::api::braille_display_private::KeyEvent; | 41 using extensions::api::braille_display_private::KeyEvent; |
42 using extensions::api::braille_display_private::MockBrailleController; | 42 using extensions::api::braille_display_private::MockBrailleController; |
43 | 43 |
44 namespace chromeos { | 44 namespace chromeos { |
45 | 45 |
46 namespace { | 46 namespace { |
47 | 47 |
48 const char kTestUserName[] = "owner@invalid.domain"; | 48 const char kTestUserName[] = "owner@invalid.domain"; |
49 | 49 |
50 const int kTestAutoclickDelayMs = 2000; | 50 const int kTestAutoclickDelayMs = 2000; |
51 | 51 |
52 // Test user name for locally managed user. The domain part must be matched | 52 // Test user name for locally managed user. The domain part must be matched |
53 // with UserManager::kLocallyManagedUserDomain. | 53 // with chromeos::login::kLocallyManagedUserDomain. |
54 const char kTestLocallyManagedUserName[] = "test@locally-managed.localhost"; | 54 const char kTestLocallyManagedUserName[] = "test@locally-managed.localhost"; |
55 | 55 |
56 class MockAccessibilityObserver { | 56 class MockAccessibilityObserver { |
57 public: | 57 public: |
58 MockAccessibilityObserver() : observed_(false), | 58 MockAccessibilityObserver() : observed_(false), |
59 observed_enabled_(false), | 59 observed_enabled_(false), |
60 observed_type_(-1) | 60 observed_type_(-1) |
61 { | 61 { |
62 AccessibilityManager* accessibility_manager = AccessibilityManager::Get(); | 62 AccessibilityManager* accessibility_manager = AccessibilityManager::Get(); |
63 CHECK(accessibility_manager); | 63 CHECK(accessibility_manager); |
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
557 virtual ~AccessibilityManagerUserTypeTest() {} | 557 virtual ~AccessibilityManagerUserTypeTest() {} |
558 | 558 |
559 DISALLOW_COPY_AND_ASSIGN(AccessibilityManagerUserTypeTest); | 559 DISALLOW_COPY_AND_ASSIGN(AccessibilityManagerUserTypeTest); |
560 }; | 560 }; |
561 | 561 |
562 // TODO(yoshiki): Enable a test for retail mode. | 562 // TODO(yoshiki): Enable a test for retail mode. |
563 INSTANTIATE_TEST_CASE_P( | 563 INSTANTIATE_TEST_CASE_P( |
564 UserTypeInstantiation, | 564 UserTypeInstantiation, |
565 AccessibilityManagerUserTypeTest, | 565 AccessibilityManagerUserTypeTest, |
566 ::testing::Values(kTestUserName, | 566 ::testing::Values(kTestUserName, |
567 UserManager::kGuestUserName, | 567 chromeos::login::kGuestUserName, |
568 //UserManager::kRetailModeUserName, | 568 // chromeos::login::kRetailModeUserName, |
569 kTestLocallyManagedUserName)); | 569 kTestLocallyManagedUserName)); |
570 | 570 |
571 IN_PROC_BROWSER_TEST_P(AccessibilityManagerUserTypeTest, | 571 IN_PROC_BROWSER_TEST_P(AccessibilityManagerUserTypeTest, |
572 EnableOnLoginScreenAndLogin) { | 572 EnableOnLoginScreenAndLogin) { |
573 // Enables large cursor. | 573 // Enables large cursor. |
574 SetLargeCursorEnabled(true); | 574 SetLargeCursorEnabled(true); |
575 EXPECT_TRUE(IsLargeCursorEnabled()); | 575 EXPECT_TRUE(IsLargeCursorEnabled()); |
576 // Enables spoken feedback. | 576 // Enables spoken feedback. |
577 SetSpokenFeedbackEnabled(true); | 577 SetSpokenFeedbackEnabled(true); |
578 EXPECT_TRUE(IsSpokenFeedbackEnabled()); | 578 EXPECT_TRUE(IsSpokenFeedbackEnabled()); |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
702 EXPECT_FALSE(ShouldShowAccessibilityMenu()); | 702 EXPECT_FALSE(ShouldShowAccessibilityMenu()); |
703 | 703 |
704 // Check on-screen keyboard. | 704 // Check on-screen keyboard. |
705 SetVirtualKeyboardEnabled(true); | 705 SetVirtualKeyboardEnabled(true); |
706 EXPECT_TRUE(ShouldShowAccessibilityMenu()); | 706 EXPECT_TRUE(ShouldShowAccessibilityMenu()); |
707 SetVirtualKeyboardEnabled(false); | 707 SetVirtualKeyboardEnabled(false); |
708 EXPECT_FALSE(ShouldShowAccessibilityMenu()); | 708 EXPECT_FALSE(ShouldShowAccessibilityMenu()); |
709 } | 709 } |
710 | 710 |
711 } // namespace chromeos | 711 } // namespace chromeos |
OLD | NEW |