| 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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 " \"Battery\": 2000" | 116 " \"Battery\": 2000" |
| 117 "}"; | 117 "}"; |
| 118 | 118 |
| 119 } // namespace | 119 } // namespace |
| 120 | 120 |
| 121 class PowerPolicyBrowserTestBase : public DevicePolicyCrosBrowserTest { | 121 class PowerPolicyBrowserTestBase : public DevicePolicyCrosBrowserTest { |
| 122 protected: | 122 protected: |
| 123 PowerPolicyBrowserTestBase(); | 123 PowerPolicyBrowserTestBase(); |
| 124 | 124 |
| 125 // DevicePolicyCrosBrowserTest: | 125 // DevicePolicyCrosBrowserTest: |
| 126 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE; | 126 virtual void SetUpInProcessBrowserTestFixture() override; |
| 127 virtual void SetUpOnMainThread() OVERRIDE; | 127 virtual void SetUpOnMainThread() override; |
| 128 | 128 |
| 129 void InstallUserKey(); | 129 void InstallUserKey(); |
| 130 void StoreAndReloadUserPolicy(); | 130 void StoreAndReloadUserPolicy(); |
| 131 | 131 |
| 132 void StoreAndReloadDevicePolicyAndWaitForLoginProfileChange(); | 132 void StoreAndReloadDevicePolicyAndWaitForLoginProfileChange(); |
| 133 | 133 |
| 134 // Returns a string describing |policy|. | 134 // Returns a string describing |policy|. |
| 135 std::string GetDebugString(const pm::PowerManagementPolicy& policy); | 135 std::string GetDebugString(const pm::PowerManagementPolicy& policy); |
| 136 | 136 |
| 137 UserPolicyBuilder user_policy_; | 137 UserPolicyBuilder user_policy_; |
| (...skipping 10 matching lines...) Expand all 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(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 DISALLOW_COPY_AND_ASSIGN(PowerPolicyLoginScreenBrowserTest); | 162 DISALLOW_COPY_AND_ASSIGN(PowerPolicyLoginScreenBrowserTest); |
| 163 }; | 163 }; |
| 164 | 164 |
| 165 class PowerPolicyInSessionBrowserTest : public PowerPolicyBrowserTestBase { | 165 class PowerPolicyInSessionBrowserTest : public PowerPolicyBrowserTestBase { |
| 166 protected: | 166 protected: |
| 167 PowerPolicyInSessionBrowserTest(); | 167 PowerPolicyInSessionBrowserTest(); |
| 168 | 168 |
| 169 // PowerPolicyBrowserTestBase: | 169 // PowerPolicyBrowserTestBase: |
| 170 virtual void SetUpOnMainThread() OVERRIDE; | 170 virtual void SetUpOnMainThread() override; |
| 171 | 171 |
| 172 DISALLOW_COPY_AND_ASSIGN(PowerPolicyInSessionBrowserTest); | 172 DISALLOW_COPY_AND_ASSIGN(PowerPolicyInSessionBrowserTest); |
| 173 }; | 173 }; |
| 174 | 174 |
| 175 PowerPolicyBrowserTestBase::PowerPolicyBrowserTestBase() | 175 PowerPolicyBrowserTestBase::PowerPolicyBrowserTestBase() |
| 176 : power_manager_client_(NULL) { | 176 : power_manager_client_(NULL) { |
| 177 } | 177 } |
| 178 | 178 |
| 179 void PowerPolicyBrowserTestBase::SetUpInProcessBrowserTestFixture() { | 179 void PowerPolicyBrowserTestBase::SetUpInProcessBrowserTestFixture() { |
| 180 DevicePolicyCrosBrowserTest::SetUpInProcessBrowserTestFixture(); | 180 DevicePolicyCrosBrowserTest::SetUpInProcessBrowserTestFixture(); |
| (...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 504 policy = baseline_policy; | 504 policy = baseline_policy; |
| 505 policy.set_ac_idle_action(power_manager_client_->policy().ac_idle_action()); | 505 policy.set_ac_idle_action(power_manager_client_->policy().ac_idle_action()); |
| 506 policy.set_battery_idle_action( | 506 policy.set_battery_idle_action( |
| 507 power_manager_client_->policy().battery_idle_action()); | 507 power_manager_client_->policy().battery_idle_action()); |
| 508 policy.set_reason(power_manager_client_->policy().reason()); | 508 policy.set_reason(power_manager_client_->policy().reason()); |
| 509 EXPECT_EQ(GetDebugString(policy), | 509 EXPECT_EQ(GetDebugString(policy), |
| 510 GetDebugString(power_manager_client_->policy())); | 510 GetDebugString(power_manager_client_->policy())); |
| 511 } | 511 } |
| 512 | 512 |
| 513 } // namespace policy | 513 } // namespace policy |
| OLD | NEW |