Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(256)

Side by Side Diff: chrome/browser/chromeos/system/tray_accessibility_browsertest.cc

Issue 1940153002: Use std::unique_ptr to express ownership of base::Value in PolicyMap::Entry (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: another-fix Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 AccessibilityManager::SetBrailleControllerForTest(NULL); 95 AccessibilityManager::SetBrailleControllerForTest(NULL);
96 } 96 }
97 97
98 void SetShowAccessibilityOptionsInSystemTrayMenu(bool value) { 98 void SetShowAccessibilityOptionsInSystemTrayMenu(bool value) {
99 if (GetParam() == PREF_SERVICE) { 99 if (GetParam() == PREF_SERVICE) {
100 PrefService* prefs = GetProfile()->GetPrefs(); 100 PrefService* prefs = GetProfile()->GetPrefs();
101 prefs->SetBoolean(prefs::kShouldAlwaysShowAccessibilityMenu, value); 101 prefs->SetBoolean(prefs::kShouldAlwaysShowAccessibilityMenu, value);
102 } else if (GetParam() == POLICY) { 102 } else if (GetParam() == POLICY) {
103 policy::PolicyMap policy_map; 103 policy::PolicyMap policy_map;
104 policy_map.Set(policy::key::kShowAccessibilityOptionsInSystemTrayMenu, 104 policy_map.Set(policy::key::kShowAccessibilityOptionsInSystemTrayMenu,
105 policy::POLICY_LEVEL_MANDATORY, 105 policy::POLICY_LEVEL_MANDATORY, policy::POLICY_SCOPE_USER,
106 policy::POLICY_SCOPE_USER,
107 policy::POLICY_SOURCE_CLOUD, 106 policy::POLICY_SOURCE_CLOUD,
108 new base::FundamentalValue(value), 107 base::WrapUnique(new base::FundamentalValue(value)),
109 NULL); 108 nullptr);
110 provider_.UpdateChromePolicy(policy_map); 109 provider_.UpdateChromePolicy(policy_map);
111 base::RunLoop().RunUntilIdle(); 110 base::RunLoop().RunUntilIdle();
112 } else { 111 } else {
113 FAIL() << "Unknown test parameterization"; 112 FAIL() << "Unknown test parameterization";
114 } 113 }
115 } 114 }
116 115
117 ash::TrayAccessibility* tray() { 116 ash::TrayAccessibility* tray() {
118 return ash::Shell::GetInstance()->GetPrimarySystemTray()-> 117 return ash::Shell::GetInstance()->GetPrimarySystemTray()->
119 GetTrayAccessibilityForTest(); 118 GetTrayAccessibilityForTest();
(...skipping 785 matching lines...) Expand 10 before | Expand all | Expand 10 after
905 EXPECT_FALSE(IsSettingsShownOnDetailMenu()); 904 EXPECT_FALSE(IsSettingsShownOnDetailMenu());
906 CloseDetailMenu(); 905 CloseDetailMenu();
907 } 906 }
908 907
909 INSTANTIATE_TEST_CASE_P(TrayAccessibilityTestInstance, 908 INSTANTIATE_TEST_CASE_P(TrayAccessibilityTestInstance,
910 TrayAccessibilityTest, 909 TrayAccessibilityTest,
911 testing::Values(PREF_SERVICE, 910 testing::Values(PREF_SERVICE,
912 POLICY)); 911 POLICY));
913 912
914 } // namespace chromeos 913 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698