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 #include <vector> | 6 #include <vector> |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 PowerPolicyBrowserTestBase::CleanUpOnMainThread(); | 300 PowerPolicyBrowserTestBase::CleanUpOnMainThread(); |
301 } | 301 } |
302 | 302 |
303 PowerPolicyInSessionBrowserTest::PowerPolicyInSessionBrowserTest() { | 303 PowerPolicyInSessionBrowserTest::PowerPolicyInSessionBrowserTest() { |
304 } | 304 } |
305 | 305 |
306 void PowerPolicyInSessionBrowserTest::SetUpOnMainThread() { | 306 void PowerPolicyInSessionBrowserTest::SetUpOnMainThread() { |
307 PowerPolicyBrowserTestBase::SetUpOnMainThread(); | 307 PowerPolicyBrowserTestBase::SetUpOnMainThread(); |
308 | 308 |
309 // Tell the DeviceSettingsService that there is no local owner. | 309 // Tell the DeviceSettingsService that there is no local owner. |
310 chromeos::DeviceSettingsService::Get()->SetUsername(std::string()); | 310 crypto::ScopedPK11Slot slot; |
| 311 chromeos::DeviceSettingsService::Get()->InitOwner(std::string(), slot.Pass()); |
311 } | 312 } |
312 | 313 |
313 // Verifies that device policy is applied on the login screen. | 314 // Verifies that device policy is applied on the login screen. |
314 IN_PROC_BROWSER_TEST_F(PowerPolicyLoginScreenBrowserTest, SetDevicePolicy) { | 315 IN_PROC_BROWSER_TEST_F(PowerPolicyLoginScreenBrowserTest, SetDevicePolicy) { |
315 pm::PowerManagementPolicy power_management_policy = | 316 pm::PowerManagementPolicy power_management_policy = |
316 power_manager_client_->policy(); | 317 power_manager_client_->policy(); |
317 power_management_policy.mutable_ac_delays()->set_screen_dim_ms(5000); | 318 power_management_policy.mutable_ac_delays()->set_screen_dim_ms(5000); |
318 power_management_policy.mutable_ac_delays()->set_screen_off_ms(7000); | 319 power_management_policy.mutable_ac_delays()->set_screen_off_ms(7000); |
319 power_management_policy.mutable_ac_delays()->set_idle_ms(9000); | 320 power_management_policy.mutable_ac_delays()->set_idle_ms(9000); |
320 power_management_policy.mutable_battery_delays()->set_screen_dim_ms(1000); | 321 power_management_policy.mutable_battery_delays()->set_screen_dim_ms(1000); |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
510 policy = baseline_policy; | 511 policy = baseline_policy; |
511 policy.set_ac_idle_action(power_manager_client_->policy().ac_idle_action()); | 512 policy.set_ac_idle_action(power_manager_client_->policy().ac_idle_action()); |
512 policy.set_battery_idle_action( | 513 policy.set_battery_idle_action( |
513 power_manager_client_->policy().battery_idle_action()); | 514 power_manager_client_->policy().battery_idle_action()); |
514 policy.set_reason(power_manager_client_->policy().reason()); | 515 policy.set_reason(power_manager_client_->policy().reason()); |
515 EXPECT_EQ(GetDebugString(policy), | 516 EXPECT_EQ(GetDebugString(policy), |
516 GetDebugString(power_manager_client_->policy())); | 517 GetDebugString(power_manager_client_->policy())); |
517 } | 518 } |
518 | 519 |
519 } // namespace policy | 520 } // namespace policy |
OLD | NEW |