| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ash/magnifier/magnification_controller.h" | 5 #include "ash/magnifier/magnification_controller.h" |
| 6 #include "ash/shell.h" | 6 #include "ash/shell.h" |
| 7 #include "ash/system/tray/system_tray.h" | 7 #include "ash/system/tray/system_tray.h" |
| 8 #include "ash/system/tray_accessibility.h" | 8 #include "ash/system/tray_accessibility.h" |
| 9 #include "ash/system/user/login_status.h" | 9 #include "ash/system/user/login_status.h" |
| 10 #include "ash/test/shell_test_api.h" | 10 #include "ash/test/shell_test_api.h" |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 class TrayAccessibilityTest | 61 class TrayAccessibilityTest |
| 62 : public InProcessBrowserTest, | 62 : public InProcessBrowserTest, |
| 63 public WithParamInterface<PrefSettingMechanism> { | 63 public WithParamInterface<PrefSettingMechanism> { |
| 64 protected: | 64 protected: |
| 65 TrayAccessibilityTest() {} | 65 TrayAccessibilityTest() {} |
| 66 virtual ~TrayAccessibilityTest() {} | 66 virtual ~TrayAccessibilityTest() {} |
| 67 | 67 |
| 68 // The profile which should be used by these tests. | 68 // The profile which should be used by these tests. |
| 69 Profile* GetProfile() { return ProfileManager::GetActiveUserProfile(); } | 69 Profile* GetProfile() { return ProfileManager::GetActiveUserProfile(); } |
| 70 | 70 |
| 71 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { | 71 virtual void SetUpInProcessBrowserTestFixture() override { |
| 72 EXPECT_CALL(provider_, IsInitializationComplete(_)) | 72 EXPECT_CALL(provider_, IsInitializationComplete(_)) |
| 73 .WillRepeatedly(Return(true)); | 73 .WillRepeatedly(Return(true)); |
| 74 policy::BrowserPolicyConnector::SetPolicyProviderForTesting(&provider_); | 74 policy::BrowserPolicyConnector::SetPolicyProviderForTesting(&provider_); |
| 75 AccessibilityManager::SetBrailleControllerForTest(&braille_controller_); | 75 AccessibilityManager::SetBrailleControllerForTest(&braille_controller_); |
| 76 } | 76 } |
| 77 | 77 |
| 78 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 78 virtual void SetUpCommandLine(CommandLine* command_line) override { |
| 79 command_line->AppendSwitch(switches::kLoginManager); | 79 command_line->AppendSwitch(switches::kLoginManager); |
| 80 command_line->AppendSwitchASCII(switches::kLoginProfile, | 80 command_line->AppendSwitchASCII(switches::kLoginProfile, |
| 81 TestingProfile::kTestUserProfileDir); | 81 TestingProfile::kTestUserProfileDir); |
| 82 } | 82 } |
| 83 | 83 |
| 84 virtual void SetUpOnMainThread() OVERRIDE { | 84 virtual void SetUpOnMainThread() override { |
| 85 AccessibilityManager::Get()->SetProfileForTest(GetProfile()); | 85 AccessibilityManager::Get()->SetProfileForTest(GetProfile()); |
| 86 MagnificationManager::Get()->SetProfileForTest(GetProfile()); | 86 MagnificationManager::Get()->SetProfileForTest(GetProfile()); |
| 87 } | 87 } |
| 88 | 88 |
| 89 virtual void RunTestOnMainThreadLoop() OVERRIDE { | 89 virtual void RunTestOnMainThreadLoop() override { |
| 90 // Need to mark oobe completed to show detailed views. | 90 // Need to mark oobe completed to show detailed views. |
| 91 StartupUtils::MarkOobeCompleted(); | 91 StartupUtils::MarkOobeCompleted(); |
| 92 InProcessBrowserTest::RunTestOnMainThreadLoop(); | 92 InProcessBrowserTest::RunTestOnMainThreadLoop(); |
| 93 } | 93 } |
| 94 | 94 |
| 95 virtual void TearDownOnMainThread() OVERRIDE { | 95 virtual void TearDownOnMainThread() override { |
| 96 AccessibilityManager::SetBrailleControllerForTest(NULL); | 96 AccessibilityManager::SetBrailleControllerForTest(NULL); |
| 97 } | 97 } |
| 98 | 98 |
| 99 void SetShowAccessibilityOptionsInSystemTrayMenu(bool value) { | 99 void SetShowAccessibilityOptionsInSystemTrayMenu(bool value) { |
| 100 if (GetParam() == PREF_SERVICE) { | 100 if (GetParam() == PREF_SERVICE) { |
| 101 PrefService* prefs = GetProfile()->GetPrefs(); | 101 PrefService* prefs = GetProfile()->GetPrefs(); |
| 102 prefs->SetBoolean(prefs::kShouldAlwaysShowAccessibilityMenu, value); | 102 prefs->SetBoolean(prefs::kShouldAlwaysShowAccessibilityMenu, value); |
| 103 } else if (GetParam() == POLICY) { | 103 } else if (GetParam() == POLICY) { |
| 104 policy::PolicyMap policy_map; | 104 policy::PolicyMap policy_map; |
| 105 policy_map.Set(policy::key::kShowAccessibilityOptionsInSystemTrayMenu, | 105 policy_map.Set(policy::key::kShowAccessibilityOptionsInSystemTrayMenu, |
| (...skipping 803 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 909 EXPECT_FALSE(IsSettingsShownOnDetailMenu()); | 909 EXPECT_FALSE(IsSettingsShownOnDetailMenu()); |
| 910 CloseDetailMenu(); | 910 CloseDetailMenu(); |
| 911 } | 911 } |
| 912 | 912 |
| 913 INSTANTIATE_TEST_CASE_P(TrayAccessibilityTestInstance, | 913 INSTANTIATE_TEST_CASE_P(TrayAccessibilityTestInstance, |
| 914 TrayAccessibilityTest, | 914 TrayAccessibilityTest, |
| 915 testing::Values(PREF_SERVICE, | 915 testing::Values(PREF_SERVICE, |
| 916 POLICY)); | 916 POLICY)); |
| 917 | 917 |
| 918 } // namespace chromeos | 918 } // namespace chromeos |
| OLD | NEW |