OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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/power/power_prefs.h" | 5 #include "chrome/browser/chromeos/power/power_prefs.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 expected_policy.set_use_audio_activity( | 141 expected_policy.set_use_audio_activity( |
142 prefs->GetBoolean(prefs::kPowerUseAudioActivity)); | 142 prefs->GetBoolean(prefs::kPowerUseAudioActivity)); |
143 expected_policy.set_use_video_activity( | 143 expected_policy.set_use_video_activity( |
144 prefs->GetBoolean(prefs::kPowerUseVideoActivity)); | 144 prefs->GetBoolean(prefs::kPowerUseVideoActivity)); |
145 expected_policy.set_presentation_screen_dim_delay_factor( | 145 expected_policy.set_presentation_screen_dim_delay_factor( |
146 prefs->GetDouble(prefs::kPowerPresentationScreenDimDelayFactor)); | 146 prefs->GetDouble(prefs::kPowerPresentationScreenDimDelayFactor)); |
147 expected_policy.set_user_activity_screen_dim_delay_factor( | 147 expected_policy.set_user_activity_screen_dim_delay_factor( |
148 prefs->GetDouble(prefs::kPowerUserActivityScreenDimDelayFactor)); | 148 prefs->GetDouble(prefs::kPowerUserActivityScreenDimDelayFactor)); |
149 expected_policy.set_wait_for_initial_user_activity( | 149 expected_policy.set_wait_for_initial_user_activity( |
150 prefs->GetBoolean(prefs::kPowerWaitForInitialUserActivity)); | 150 prefs->GetBoolean(prefs::kPowerWaitForInitialUserActivity)); |
| 151 expected_policy.set_force_nonzero_brightness_for_user_activity( |
| 152 prefs->GetBoolean(prefs::kPowerForceNonzeroBrightnessForUserActivity)); |
151 expected_policy.set_reason("Prefs"); | 153 expected_policy.set_reason("Prefs"); |
152 return PowerPolicyController::GetPolicyDebugString(expected_policy); | 154 return PowerPolicyController::GetPolicyDebugString(expected_policy); |
153 } | 155 } |
154 | 156 |
155 std::string PowerPrefsTest::GetCurrentPowerPolicy() const { | 157 std::string PowerPrefsTest::GetCurrentPowerPolicy() const { |
156 return PowerPolicyController::GetPolicyDebugString( | 158 return PowerPolicyController::GetPolicyDebugString( |
157 fake_power_manager_client_->policy()); | 159 fake_power_manager_client_->policy()); |
158 } | 160 } |
159 | 161 |
160 bool PowerPrefsTest::GetCurrentAllowScreenWakeLocks() const { | 162 bool PowerPrefsTest::GetCurrentAllowScreenWakeLocks() const { |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 content::Source<Profile>(user_profile), | 293 content::Source<Profile>(user_profile), |
292 content::NotificationService::NoDetails()); | 294 content::NotificationService::NoDetails()); |
293 | 295 |
294 // The user profile's prefs should still be used. | 296 // The user profile's prefs should still be used. |
295 EXPECT_FALSE(GetProfile()); | 297 EXPECT_FALSE(GetProfile()); |
296 EXPECT_EQ(GetExpectedPowerPolicyForProfile(user_profile, UNLOCKED), | 298 EXPECT_EQ(GetExpectedPowerPolicyForProfile(user_profile, UNLOCKED), |
297 GetCurrentPowerPolicy()); | 299 GetCurrentPowerPolicy()); |
298 } | 300 } |
299 | 301 |
300 } // namespace chromeos | 302 } // namespace chromeos |
OLD | NEW |