1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "chrome/browser/chromeos/policy/fake_device_cloud_policy_initializer.h"
7 #include "base/memory/ref_counted.h"
8 #include "base/sequenced_task_runner.h"
9 #include "components/policy/core/common/cloud/device_management_service.h"
13 FakeDeviceCloudPolicyInitializer::FakeDeviceCloudPolicyInitializer()
14 : DeviceCloudPolicyInitializer(
16 NULL
, // enterprise_service
17 NULL
, // consumer_service
18 // background_task_runner
19 scoped_refptr
<base::SequencedTaskRunner
>(NULL
),
20 NULL
, // install_attributes
21 NULL
, // state_keys_broker
24 was_start_enrollment_called_(false),
25 enrollment_status_(EnrollmentStatus::ForStatus(
26 EnrollmentStatus::STATUS_SUCCESS
)) {
29 void FakeDeviceCloudPolicyInitializer::Init() {
32 void FakeDeviceCloudPolicyInitializer::Shutdown() {
35 void FakeDeviceCloudPolicyInitializer::StartEnrollment(
36 ManagementMode management_mode
,
37 DeviceManagementService
* device_management_service
,
38 chromeos::OwnerSettingsServiceChromeOS
* owner_settings_service
,
39 const EnrollmentConfig
& enrollment_config
,
40 const std::string
& auth_token
,
41 const AllowedDeviceModes
& allowed_modes
,
42 const EnrollmentCallback
& enrollment_callback
) {
43 was_start_enrollment_called_
= true;
44 enrollment_callback
.Run(enrollment_status_
);