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

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: Fixed tests. 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 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698