| 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 15 matching lines...) Expand all Loading... |
| 26 #include "chrome/browser/lifetime/application_lifetime.h" | 26 #include "chrome/browser/lifetime/application_lifetime.h" |
| 27 #include "chrome/browser/policy/profile_policy_connector.h" | 27 #include "chrome/browser/policy/profile_policy_connector.h" |
| 28 #include "chrome/browser/policy/profile_policy_connector_factory.h" | 28 #include "chrome/browser/policy/profile_policy_connector_factory.h" |
| 29 #include "chrome/browser/profiles/profile.h" | 29 #include "chrome/browser/profiles/profile.h" |
| 30 #include "chrome/browser/profiles/profile_manager.h" | 30 #include "chrome/browser/profiles/profile_manager.h" |
| 31 #include "chrome/browser/ui/browser.h" | 31 #include "chrome/browser/ui/browser.h" |
| 32 #include "chrome/test/base/testing_profile.h" | 32 #include "chrome/test/base/testing_profile.h" |
| 33 #include "chromeos/chromeos_paths.h" | 33 #include "chromeos/chromeos_paths.h" |
| 34 #include "chromeos/chromeos_switches.h" | 34 #include "chromeos/chromeos_switches.h" |
| 35 #include "chromeos/dbus/cryptohome_client.h" | 35 #include "chromeos/dbus/cryptohome_client.h" |
| 36 #include "chromeos/dbus/fake_dbus_thread_manager.h" | 36 #include "chromeos/dbus/dbus_thread_manager.h" |
| 37 #include "chromeos/dbus/fake_power_manager_client.h" | 37 #include "chromeos/dbus/fake_power_manager_client.h" |
| 38 #include "chromeos/dbus/fake_session_manager_client.h" | 38 #include "chromeos/dbus/fake_session_manager_client.h" |
| 39 #include "chromeos/dbus/power_manager/policy.pb.h" | 39 #include "chromeos/dbus/power_manager/policy.pb.h" |
| 40 #include "chromeos/dbus/power_policy_controller.h" | 40 #include "chromeos/dbus/power_policy_controller.h" |
| 41 #include "chromeos/login/user_names.h" | 41 #include "chromeos/login/user_names.h" |
| 42 #include "components/policy/core/common/cloud/cloud_policy_core.h" | 42 #include "components/policy/core/common/cloud/cloud_policy_core.h" |
| 43 #include "components/policy/core/common/cloud/cloud_policy_store.h" | 43 #include "components/policy/core/common/cloud/cloud_policy_store.h" |
| 44 #include "components/policy/core/common/cloud/policy_builder.h" | 44 #include "components/policy/core/common/cloud/policy_builder.h" |
| 45 #include "components/policy/core/common/external_data_fetcher.h" | 45 #include "components/policy/core/common/external_data_fetcher.h" |
| 46 #include "components/policy/core/common/mock_policy_service.h" | 46 #include "components/policy/core/common/mock_policy_service.h" |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 power_manager_client_ = new chromeos::FakePowerManagerClient; | 181 power_manager_client_ = new chromeos::FakePowerManagerClient; |
| 181 fake_dbus_thread_manager()->SetPowerManagerClient( | 182 dbus_helper()->SetPowerManagerClient( |
| 182 scoped_ptr<chromeos::PowerManagerClient>(power_manager_client_)); | 183 scoped_ptr<chromeos::PowerManagerClient>(power_manager_client_)); |
| 183 | 184 |
| 184 DevicePolicyCrosBrowserTest::SetUpInProcessBrowserTestFixture(); | |
| 185 | |
| 186 // Initialize device policy. | 185 // Initialize device policy. |
| 187 InstallOwnerKey(); | 186 InstallOwnerKey(); |
| 188 MarkAsEnterpriseOwned(); | 187 MarkAsEnterpriseOwned(); |
| 189 } | 188 } |
| 190 | 189 |
| 191 void PowerPolicyBrowserTestBase::SetUpOnMainThread() { | 190 void PowerPolicyBrowserTestBase::SetUpOnMainThread() { |
| 192 DevicePolicyCrosBrowserTest::SetUpOnMainThread(); | 191 DevicePolicyCrosBrowserTest::SetUpOnMainThread(); |
| 193 | 192 |
| 194 // Initialize user policy. | 193 // Initialize user policy. |
| 195 InstallUserKey(); | 194 InstallUserKey(); |
| (...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 505 policy = baseline_policy; | 504 policy = baseline_policy; |
| 506 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()); |
| 507 policy.set_battery_idle_action( | 506 policy.set_battery_idle_action( |
| 508 power_manager_client_->policy().battery_idle_action()); | 507 power_manager_client_->policy().battery_idle_action()); |
| 509 policy.set_reason(power_manager_client_->policy().reason()); | 508 policy.set_reason(power_manager_client_->policy().reason()); |
| 510 EXPECT_EQ(GetDebugString(policy), | 509 EXPECT_EQ(GetDebugString(policy), |
| 511 GetDebugString(power_manager_client_->policy())); | 510 GetDebugString(power_manager_client_->policy())); |
| 512 } | 511 } |
| 513 | 512 |
| 514 } // namespace policy | 513 } // namespace policy |
| OLD | NEW |