OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/chromeos/policy/device_cloud_policy_manager_chromeos.h" | 5 #include "chrome/browser/chromeos/policy/device_cloud_policy_manager_chromeos.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | |
9 #include <algorithm> | 8 #include <algorithm> |
| 9 #include <utility> |
10 | 10 |
11 #include "base/bind.h" | 11 #include "base/bind.h" |
12 #include "base/bind_helpers.h" | 12 #include "base/bind_helpers.h" |
13 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
14 #include "base/macros.h" | 14 #include "base/macros.h" |
15 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
16 #include "base/prefs/pref_registry_simple.h" | 16 #include "base/prefs/pref_registry_simple.h" |
17 #include "base/prefs/testing_pref_service.h" | 17 #include "base/prefs/testing_pref_service.h" |
18 #include "base/run_loop.h" | 18 #include "base/run_loop.h" |
19 #include "base/thread_task_runner_handle.h" | 19 #include "base/thread_task_runner_handle.h" |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 loop->Quit(); | 76 loop->Quit(); |
77 } | 77 } |
78 | 78 |
79 class TestingDeviceCloudPolicyManagerChromeOS | 79 class TestingDeviceCloudPolicyManagerChromeOS |
80 : public DeviceCloudPolicyManagerChromeOS { | 80 : public DeviceCloudPolicyManagerChromeOS { |
81 public: | 81 public: |
82 TestingDeviceCloudPolicyManagerChromeOS( | 82 TestingDeviceCloudPolicyManagerChromeOS( |
83 scoped_ptr<DeviceCloudPolicyStoreChromeOS> store, | 83 scoped_ptr<DeviceCloudPolicyStoreChromeOS> store, |
84 const scoped_refptr<base::SequencedTaskRunner>& task_runner, | 84 const scoped_refptr<base::SequencedTaskRunner>& task_runner, |
85 ServerBackedStateKeysBroker* state_keys_broker) | 85 ServerBackedStateKeysBroker* state_keys_broker) |
86 : DeviceCloudPolicyManagerChromeOS( | 86 : DeviceCloudPolicyManagerChromeOS(std::move(store), |
87 store.Pass(), task_runner, state_keys_broker) {} | 87 task_runner, |
| 88 state_keys_broker) {} |
88 ~TestingDeviceCloudPolicyManagerChromeOS() override {} | 89 ~TestingDeviceCloudPolicyManagerChromeOS() override {} |
89 }; | 90 }; |
90 | 91 |
91 class DeviceCloudPolicyManagerChromeOSTest | 92 class DeviceCloudPolicyManagerChromeOSTest |
92 : public chromeos::DeviceSettingsTestBase, | 93 : public chromeos::DeviceSettingsTestBase, |
93 public DeviceCloudPolicyManagerChromeOS::Observer { | 94 public DeviceCloudPolicyManagerChromeOS::Observer { |
94 protected: | 95 protected: |
95 DeviceCloudPolicyManagerChromeOSTest() | 96 DeviceCloudPolicyManagerChromeOSTest() |
96 : fake_cryptohome_client_(new chromeos::FakeCryptohomeClient()), | 97 : fake_cryptohome_client_(new chromeos::FakeCryptohomeClient()), |
97 state_keys_broker_(&fake_session_manager_client_, | 98 state_keys_broker_(&fake_session_manager_client_, |
(...skipping 649 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
747 | 748 |
748 TEST_F(DeviceCloudPolicyManagerChromeOSEnrollmentBlankSystemSaltTest, | 749 TEST_F(DeviceCloudPolicyManagerChromeOSEnrollmentBlankSystemSaltTest, |
749 RobotRefreshSaveFailed) { | 750 RobotRefreshSaveFailed) { |
750 // Without the system salt, the robot token can't be stored. | 751 // Without the system salt, the robot token can't be stored. |
751 RunTest(); | 752 RunTest(); |
752 ExpectFailedEnrollment(EnrollmentStatus::STATUS_ROBOT_REFRESH_STORE_FAILED); | 753 ExpectFailedEnrollment(EnrollmentStatus::STATUS_ROBOT_REFRESH_STORE_FAILED); |
753 } | 754 } |
754 | 755 |
755 } // namespace | 756 } // namespace |
756 } // namespace policy | 757 } // namespace policy |
OLD | NEW |