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 <string> | 5 #include <string> |
6 | 6 |
7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
9 #include "base/values.h" | 9 #include "base/values.h" |
10 #include "chrome/browser/extensions/api/power/power_api_manager.h" | 10 #include "chrome/browser/extensions/api/power/power_api_manager.h" |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 GetDebugString(power_manager_client_->get_policy())); | 174 GetDebugString(power_manager_client_->get_policy())); |
175 | 175 |
176 power_management_policy = original_power_management_policy; | 176 power_management_policy = original_power_management_policy; |
177 power_management_policy.set_use_video_activity(false); | 177 power_management_policy.set_use_video_activity(false); |
178 SetUserPolicy(key::kPowerManagementUsesVideoActivity, | 178 SetUserPolicy(key::kPowerManagementUsesVideoActivity, |
179 base::Value::CreateBooleanValue(false)); | 179 base::Value::CreateBooleanValue(false)); |
180 EXPECT_EQ(GetDebugString(power_management_policy), | 180 EXPECT_EQ(GetDebugString(power_management_policy), |
181 GetDebugString(power_manager_client_->get_policy())); | 181 GetDebugString(power_manager_client_->get_policy())); |
182 | 182 |
183 power_management_policy = original_power_management_policy; | 183 power_management_policy = original_power_management_policy; |
184 power_management_policy.set_presentation_idle_delay_factor(3.0); | 184 power_management_policy.set_presentation_screen_dim_delay_factor(3.0); |
185 SetUserPolicy(key::kPresentationIdleDelayScale, | 185 SetUserPolicy(key::kPresentationScreenDimDelayScale, |
186 base::Value::CreateIntegerValue(300)); | 186 base::Value::CreateIntegerValue(300)); |
187 EXPECT_EQ(GetDebugString(power_management_policy), | 187 EXPECT_EQ(GetDebugString(power_management_policy), |
188 GetDebugString(power_manager_client_->get_policy())); | 188 GetDebugString(power_manager_client_->get_policy())); |
189 } | 189 } |
190 | 190 |
191 IN_PROC_BROWSER_TEST_F(PowerPolicyBrowserTest, AllowScreenWakeLocks) { | 191 IN_PROC_BROWSER_TEST_F(PowerPolicyBrowserTest, AllowScreenWakeLocks) { |
192 pm::PowerManagementPolicy baseline_policy = | 192 pm::PowerManagementPolicy baseline_policy = |
193 power_manager_client_->get_policy(); | 193 power_manager_client_->get_policy(); |
194 | 194 |
195 // Default settings should have delays. | 195 // Default settings should have delays. |
(...skipping 24 matching lines...) Expand all Loading... |
220 SetUserPolicy(key::kAllowScreenWakeLocks, | 220 SetUserPolicy(key::kAllowScreenWakeLocks, |
221 base::Value::CreateBooleanValue(false)); | 221 base::Value::CreateBooleanValue(false)); |
222 policy = baseline_policy; | 222 policy = baseline_policy; |
223 policy.set_idle_action(power_manager_client_->get_policy().idle_action()); | 223 policy.set_idle_action(power_manager_client_->get_policy().idle_action()); |
224 policy.set_reason(power_manager_client_->get_policy().reason()); | 224 policy.set_reason(power_manager_client_->get_policy().reason()); |
225 EXPECT_EQ(GetDebugString(policy), | 225 EXPECT_EQ(GetDebugString(policy), |
226 GetDebugString(power_manager_client_->get_policy())); | 226 GetDebugString(power_manager_client_->get_policy())); |
227 } | 227 } |
228 | 228 |
229 } // namespace policy | 229 } // namespace policy |
OLD | NEW |