| 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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 void ReloadUserPolicy(Profile* profile); | 148 void ReloadUserPolicy(Profile* profile); |
| 149 | 149 |
| 150 DISALLOW_COPY_AND_ASSIGN(PowerPolicyBrowserTestBase); | 150 DISALLOW_COPY_AND_ASSIGN(PowerPolicyBrowserTestBase); |
| 151 }; | 151 }; |
| 152 | 152 |
| 153 class PowerPolicyLoginScreenBrowserTest : public PowerPolicyBrowserTestBase { | 153 class PowerPolicyLoginScreenBrowserTest : public PowerPolicyBrowserTestBase { |
| 154 protected: | 154 protected: |
| 155 PowerPolicyLoginScreenBrowserTest(); | 155 PowerPolicyLoginScreenBrowserTest(); |
| 156 | 156 |
| 157 // PowerPolicyBrowserTestBase: | 157 // PowerPolicyBrowserTestBase: |
| 158 virtual void SetUpCommandLine(CommandLine* command_line) override; | 158 virtual void SetUpCommandLine(base::CommandLine* command_line) override; |
| 159 virtual void SetUpOnMainThread() override; | 159 virtual void SetUpOnMainThread() override; |
| 160 virtual void TearDownOnMainThread() override; | 160 virtual void TearDownOnMainThread() override; |
| 161 | 161 |
| 162 private: | 162 private: |
| 163 DISALLOW_COPY_AND_ASSIGN(PowerPolicyLoginScreenBrowserTest); | 163 DISALLOW_COPY_AND_ASSIGN(PowerPolicyLoginScreenBrowserTest); |
| 164 }; | 164 }; |
| 165 | 165 |
| 166 class PowerPolicyInSessionBrowserTest : public PowerPolicyBrowserTestBase { | 166 class PowerPolicyInSessionBrowserTest : public PowerPolicyBrowserTestBase { |
| 167 protected: | 167 protected: |
| 168 PowerPolicyInSessionBrowserTest(); | 168 PowerPolicyInSessionBrowserTest(); |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 UserCloudPolicyManagerChromeOS* policy_manager = | 270 UserCloudPolicyManagerChromeOS* policy_manager = |
| 271 UserCloudPolicyManagerFactoryChromeOS::GetForProfile(profile); | 271 UserCloudPolicyManagerFactoryChromeOS::GetForProfile(profile); |
| 272 ASSERT_TRUE(policy_manager); | 272 ASSERT_TRUE(policy_manager); |
| 273 policy_manager->core()->store()->Load(); | 273 policy_manager->core()->store()->Load(); |
| 274 } | 274 } |
| 275 | 275 |
| 276 PowerPolicyLoginScreenBrowserTest::PowerPolicyLoginScreenBrowserTest() { | 276 PowerPolicyLoginScreenBrowserTest::PowerPolicyLoginScreenBrowserTest() { |
| 277 } | 277 } |
| 278 | 278 |
| 279 void PowerPolicyLoginScreenBrowserTest::SetUpCommandLine( | 279 void PowerPolicyLoginScreenBrowserTest::SetUpCommandLine( |
| 280 CommandLine* command_line) { | 280 base::CommandLine* command_line) { |
| 281 PowerPolicyBrowserTestBase::SetUpCommandLine(command_line); | 281 PowerPolicyBrowserTestBase::SetUpCommandLine(command_line); |
| 282 command_line->AppendSwitch(chromeos::switches::kLoginManager); | 282 command_line->AppendSwitch(chromeos::switches::kLoginManager); |
| 283 command_line->AppendSwitch(chromeos::switches::kForceLoginManagerInTests); | 283 command_line->AppendSwitch(chromeos::switches::kForceLoginManagerInTests); |
| 284 } | 284 } |
| 285 | 285 |
| 286 void PowerPolicyLoginScreenBrowserTest::SetUpOnMainThread() { | 286 void PowerPolicyLoginScreenBrowserTest::SetUpOnMainThread() { |
| 287 PowerPolicyBrowserTestBase::SetUpOnMainThread(); | 287 PowerPolicyBrowserTestBase::SetUpOnMainThread(); |
| 288 | 288 |
| 289 // Wait for the login screen to be shown. | 289 // Wait for the login screen to be shown. |
| 290 content::WindowedNotificationObserver( | 290 content::WindowedNotificationObserver( |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 506 policy = baseline_policy; | 506 policy = baseline_policy; |
| 507 policy.set_ac_idle_action(power_manager_client_->policy().ac_idle_action()); | 507 policy.set_ac_idle_action(power_manager_client_->policy().ac_idle_action()); |
| 508 policy.set_battery_idle_action( | 508 policy.set_battery_idle_action( |
| 509 power_manager_client_->policy().battery_idle_action()); | 509 power_manager_client_->policy().battery_idle_action()); |
| 510 policy.set_reason(power_manager_client_->policy().reason()); | 510 policy.set_reason(power_manager_client_->policy().reason()); |
| 511 EXPECT_EQ(GetDebugString(policy), | 511 EXPECT_EQ(GetDebugString(policy), |
| 512 GetDebugString(power_manager_client_->policy())); | 512 GetDebugString(power_manager_client_->policy())); |
| 513 } | 513 } |
| 514 | 514 |
| 515 } // namespace policy | 515 } // namespace policy |
| OLD | NEW |