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

Side by Side Diff: chrome/browser/chromeos/policy/power_policy_browsertest.cc

Issue 270663002: Implemented profile-aware owner key loading. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixes, rebase. Created 6 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 | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698