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 .Set(key::kDeviceMetricsReportingEnabled, POLICY_LEVEL_MANDATORY, |
185 POLICY_LEVEL_MANDATORY, | 185 POLICY_SCOPE_MACHINE, new base::FundamentalValue(false), NULL, |
186 POLICY_SCOPE_MACHINE, | 186 POLICY_SOURCE_CLOUD); |
187 new base::FundamentalValue(false), | |
188 NULL); | |
189 EXPECT_TRUE(manager_->policies().Equals(bundle)); | 187 EXPECT_TRUE(manager_->policies().Equals(bundle)); |
190 } | 188 } |
191 | 189 |
192 void AllowUninterestingRemoteCommandFetches() { | 190 void AllowUninterestingRemoteCommandFetches() { |
193 // We are not interested in remote command fetches that the client initiates | 191 // We are not interested in remote command fetches that the client initiates |
194 // automatically. Make them fail and ignore them otherwise. | 192 // automatically. Make them fail and ignore them otherwise. |
195 EXPECT_CALL(device_management_service_, | 193 EXPECT_CALL(device_management_service_, |
196 CreateJob(DeviceManagementRequestJob::TYPE_REMOTE_COMMANDS, _)) | 194 CreateJob(DeviceManagementRequestJob::TYPE_REMOTE_COMMANDS, _)) |
197 .Times(AnyNumber()) | 195 .Times(AnyNumber()) |
198 .WillRepeatedly(device_management_service_.FailJob( | 196 .WillRepeatedly(device_management_service_.FailJob( |
(...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
742 | 740 |
743 TEST_F(DeviceCloudPolicyManagerChromeOSEnrollmentBlankSystemSaltTest, | 741 TEST_F(DeviceCloudPolicyManagerChromeOSEnrollmentBlankSystemSaltTest, |
744 RobotRefreshSaveFailed) { | 742 RobotRefreshSaveFailed) { |
745 // Without the system salt, the robot token can't be stored. | 743 // Without the system salt, the robot token can't be stored. |
746 RunTest(); | 744 RunTest(); |
747 ExpectFailedEnrollment(EnrollmentStatus::STATUS_ROBOT_REFRESH_STORE_FAILED); | 745 ExpectFailedEnrollment(EnrollmentStatus::STATUS_ROBOT_REFRESH_STORE_FAILED); |
748 } | 746 } |
749 | 747 |
750 } // namespace | 748 } // namespace |
751 } // namespace policy | 749 } // namespace policy |
OLD | NEW |