| 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 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 &local_state_, &device_management_service_, | 180 &local_state_, &device_management_service_, |
| 181 &consumer_device_management_service_, | 181 &consumer_device_management_service_, |
| 182 base::ThreadTaskRunnerHandle::Get(), install_attributes_.get(), | 182 base::ThreadTaskRunnerHandle::Get(), install_attributes_.get(), |
| 183 &state_keys_broker_, store_, manager_.get())); | 183 &state_keys_broker_, store_, manager_.get())); |
| 184 initializer_->Init(); | 184 initializer_->Init(); |
| 185 } | 185 } |
| 186 | 186 |
| 187 void VerifyPolicyPopulated() { | 187 void VerifyPolicyPopulated() { |
| 188 PolicyBundle bundle; | 188 PolicyBundle bundle; |
| 189 bundle.Get(PolicyNamespace(POLICY_DOMAIN_CHROME, std::string())) | 189 bundle.Get(PolicyNamespace(POLICY_DOMAIN_CHROME, std::string())) |
| 190 .Set(key::kDeviceMetricsReportingEnabled, | 190 .Set(key::kDeviceMetricsReportingEnabled, POLICY_LEVEL_MANDATORY, |
| 191 POLICY_LEVEL_MANDATORY, | 191 POLICY_SCOPE_MACHINE, POLICY_SOURCE_CLOUD, |
| 192 POLICY_SCOPE_MACHINE, | 192 base::WrapUnique(new base::FundamentalValue(false)), nullptr); |
| 193 POLICY_SOURCE_CLOUD, | |
| 194 new base::FundamentalValue(false), | |
| 195 NULL); | |
| 196 EXPECT_TRUE(manager_->policies().Equals(bundle)); | 193 EXPECT_TRUE(manager_->policies().Equals(bundle)); |
| 197 } | 194 } |
| 198 | 195 |
| 199 void AllowUninterestingRemoteCommandFetches() { | 196 void AllowUninterestingRemoteCommandFetches() { |
| 200 // We are not interested in remote command fetches that the client initiates | 197 // We are not interested in remote command fetches that the client initiates |
| 201 // automatically. Make them fail and ignore them otherwise. | 198 // automatically. Make them fail and ignore them otherwise. |
| 202 EXPECT_CALL(device_management_service_, | 199 EXPECT_CALL(device_management_service_, |
| 203 CreateJob(DeviceManagementRequestJob::TYPE_REMOTE_COMMANDS, _)) | 200 CreateJob(DeviceManagementRequestJob::TYPE_REMOTE_COMMANDS, _)) |
| 204 .Times(AnyNumber()) | 201 .Times(AnyNumber()) |
| 205 .WillRepeatedly(device_management_service_.FailJob( | 202 .WillRepeatedly(device_management_service_.FailJob( |
| (...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 750 | 747 |
| 751 TEST_F(DeviceCloudPolicyManagerChromeOSEnrollmentBlankSystemSaltTest, | 748 TEST_F(DeviceCloudPolicyManagerChromeOSEnrollmentBlankSystemSaltTest, |
| 752 RobotRefreshSaveFailed) { | 749 RobotRefreshSaveFailed) { |
| 753 // Without the system salt, the robot token can't be stored. | 750 // Without the system salt, the robot token can't be stored. |
| 754 RunTest(); | 751 RunTest(); |
| 755 ExpectFailedEnrollment(EnrollmentStatus::STATUS_ROBOT_REFRESH_STORE_FAILED); | 752 ExpectFailedEnrollment(EnrollmentStatus::STATUS_ROBOT_REFRESH_STORE_FAILED); |
| 756 } | 753 } |
| 757 | 754 |
| 758 } // namespace | 755 } // namespace |
| 759 } // namespace policy | 756 } // namespace policy |
| OLD | NEW |