| 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/common/accessibility_types.h" | 5 #include "ash/common/accessibility_types.h" |
| 6 #include "ash/common/login_status.h" | 6 #include "ash/common/login_status.h" |
| 7 #include "ash/common/system/tray/system_tray.h" | 7 #include "ash/common/system/tray/system_tray.h" |
| 8 #include "ash/common/system/tray_accessibility.h" | 8 #include "ash/common/system/tray_accessibility.h" |
| 9 #include "ash/common/test/test_session_state_delegate.h" | 9 #include "ash/common/test/test_session_state_delegate.h" |
| 10 #include "ash/magnifier/magnification_controller.h" | 10 #include "ash/magnifier/magnification_controller.h" |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 | 101 |
| 102 void SetShowAccessibilityOptionsInSystemTrayMenu(bool value) { | 102 void SetShowAccessibilityOptionsInSystemTrayMenu(bool value) { |
| 103 if (GetParam() == PREF_SERVICE) { | 103 if (GetParam() == PREF_SERVICE) { |
| 104 PrefService* prefs = GetProfile()->GetPrefs(); | 104 PrefService* prefs = GetProfile()->GetPrefs(); |
| 105 prefs->SetBoolean(prefs::kShouldAlwaysShowAccessibilityMenu, value); | 105 prefs->SetBoolean(prefs::kShouldAlwaysShowAccessibilityMenu, value); |
| 106 } else if (GetParam() == POLICY) { | 106 } else if (GetParam() == POLICY) { |
| 107 policy::PolicyMap policy_map; | 107 policy::PolicyMap policy_map; |
| 108 policy_map.Set(policy::key::kShowAccessibilityOptionsInSystemTrayMenu, | 108 policy_map.Set(policy::key::kShowAccessibilityOptionsInSystemTrayMenu, |
| 109 policy::POLICY_LEVEL_MANDATORY, policy::POLICY_SCOPE_USER, | 109 policy::POLICY_LEVEL_MANDATORY, policy::POLICY_SCOPE_USER, |
| 110 policy::POLICY_SOURCE_CLOUD, | 110 policy::POLICY_SOURCE_CLOUD, |
| 111 base::MakeUnique<base::FundamentalValue>(value), nullptr); | 111 base::MakeUnique<base::Value>(value), nullptr); |
| 112 provider_.UpdateChromePolicy(policy_map); | 112 provider_.UpdateChromePolicy(policy_map); |
| 113 base::RunLoop().RunUntilIdle(); | 113 base::RunLoop().RunUntilIdle(); |
| 114 } else { | 114 } else { |
| 115 FAIL() << "Unknown test parameterization"; | 115 FAIL() << "Unknown test parameterization"; |
| 116 } | 116 } |
| 117 } | 117 } |
| 118 | 118 |
| 119 ash::TrayAccessibility* tray() { | 119 ash::TrayAccessibility* tray() { |
| 120 return ash::Shell::GetInstance()->GetPrimarySystemTray()-> | 120 return ash::Shell::GetInstance()->GetPrimarySystemTray()-> |
| 121 GetTrayAccessibilityForTest(); | 121 GetTrayAccessibilityForTest(); |
| (...skipping 785 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 907 EXPECT_FALSE(IsSettingsAvailableOnDetailMenu()); | 907 EXPECT_FALSE(IsSettingsAvailableOnDetailMenu()); |
| 908 CloseDetailMenu(); | 908 CloseDetailMenu(); |
| 909 } | 909 } |
| 910 | 910 |
| 911 INSTANTIATE_TEST_CASE_P(TrayAccessibilityTestInstance, | 911 INSTANTIATE_TEST_CASE_P(TrayAccessibilityTestInstance, |
| 912 TrayAccessibilityTest, | 912 TrayAccessibilityTest, |
| 913 testing::Values(PREF_SERVICE, | 913 testing::Values(PREF_SERVICE, |
| 914 POLICY)); | 914 POLICY)); |
| 915 | 915 |
| 916 } // namespace chromeos | 916 } // namespace chromeos |
| OLD | NEW |