| 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 <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 &local_state_, &device_management_service_, | 174 &local_state_, &device_management_service_, |
| 175 &consumer_device_management_service_, | 175 &consumer_device_management_service_, |
| 176 base::ThreadTaskRunnerHandle::Get(), install_attributes_.get(), | 176 base::ThreadTaskRunnerHandle::Get(), install_attributes_.get(), |
| 177 &state_keys_broker_, store_, manager_.get())); | 177 &state_keys_broker_, store_, manager_.get())); |
| 178 initializer_->Init(); | 178 initializer_->Init(); |
| 179 } | 179 } |
| 180 | 180 |
| 181 void VerifyPolicyPopulated() { | 181 void VerifyPolicyPopulated() { |
| 182 PolicyBundle bundle; | 182 PolicyBundle bundle; |
| 183 bundle.Get(PolicyNamespace(POLICY_DOMAIN_CHROME, std::string())) | 183 bundle.Get(PolicyNamespace(POLICY_DOMAIN_CHROME, std::string())) |
| 184 .Set(key::kDeviceMetricsReportingEnabled, | 184 .SetWithSource(key::kDeviceMetricsReportingEnabled, |
| 185 POLICY_LEVEL_MANDATORY, | 185 POLICY_LEVEL_MANDATORY, |
| 186 POLICY_SCOPE_MACHINE, | 186 POLICY_SCOPE_MACHINE, |
| 187 new base::FundamentalValue(false), | 187 new base::FundamentalValue(false), |
| 188 NULL); | 188 NULL, |
| 189 POLICY_SOURCE_CLOUD); |
| 189 EXPECT_TRUE(manager_->policies().Equals(bundle)); | 190 EXPECT_TRUE(manager_->policies().Equals(bundle)); |
| 190 } | 191 } |
| 191 | 192 |
| 192 void AllowUninterestingRemoteCommandFetches() { | 193 void AllowUninterestingRemoteCommandFetches() { |
| 193 // We are not interested in remote command fetches that the client initiates | 194 // We are not interested in remote command fetches that the client initiates |
| 194 // automatically. Make them fail and ignore them otherwise. | 195 // automatically. Make them fail and ignore them otherwise. |
| 195 EXPECT_CALL(device_management_service_, | 196 EXPECT_CALL(device_management_service_, |
| 196 CreateJob(DeviceManagementRequestJob::TYPE_REMOTE_COMMANDS, _)) | 197 CreateJob(DeviceManagementRequestJob::TYPE_REMOTE_COMMANDS, _)) |
| 197 .Times(AnyNumber()) | 198 .Times(AnyNumber()) |
| 198 .WillRepeatedly(device_management_service_.FailJob( | 199 .WillRepeatedly(device_management_service_.FailJob( |
| (...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 742 | 743 |
| 743 TEST_F(DeviceCloudPolicyManagerChromeOSEnrollmentBlankSystemSaltTest, | 744 TEST_F(DeviceCloudPolicyManagerChromeOSEnrollmentBlankSystemSaltTest, |
| 744 RobotRefreshSaveFailed) { | 745 RobotRefreshSaveFailed) { |
| 745 // Without the system salt, the robot token can't be stored. | 746 // Without the system salt, the robot token can't be stored. |
| 746 RunTest(); | 747 RunTest(); |
| 747 ExpectFailedEnrollment(EnrollmentStatus::STATUS_ROBOT_REFRESH_STORE_FAILED); | 748 ExpectFailedEnrollment(EnrollmentStatus::STATUS_ROBOT_REFRESH_STORE_FAILED); |
| 748 } | 749 } |
| 749 | 750 |
| 750 } // namespace | 751 } // namespace |
| 751 } // namespace policy | 752 } // namespace policy |
| OLD | NEW |