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