OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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/consumer_unenrollment_handler.h" | 5 #include "chrome/browser/chromeos/policy/consumer_unenrollment_handler.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/thread_task_runner_handle.h" | 10 #include "base/thread_task_runner_handle.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 fake_service_->SetStatusAndStage( | 37 fake_service_->SetStatusAndStage( |
38 ConsumerManagementService::STATUS_ENROLLED, | 38 ConsumerManagementService::STATUS_ENROLLED, |
39 ConsumerManagementStage::None()); | 39 ConsumerManagementStage::None()); |
40 } | 40 } |
41 | 41 |
42 void SetUp() override { | 42 void SetUp() override { |
43 DeviceSettingsTestBase::SetUp(); | 43 DeviceSettingsTestBase::SetUp(); |
44 | 44 |
45 // Set up the ownership, so that we can modify device settings. | 45 // Set up the ownership, so that we can modify device settings. |
46 owner_key_util_->SetPrivateKey(device_policy_.GetSigningKey()); | 46 owner_key_util_->SetPrivateKey(device_policy_.GetSigningKey()); |
47 InitOwner(device_policy_.policy_data().username(), true); | 47 InitOwner(AccountId::FromUserEmail(device_policy_.policy_data().username()), |
| 48 true); |
48 FlushDeviceSettings(); | 49 FlushDeviceSettings(); |
49 | 50 |
50 | 51 |
51 // Set up FakeDeviceCloudPolicyManager. | 52 // Set up FakeDeviceCloudPolicyManager. |
52 scoped_ptr<DeviceCloudPolicyStoreChromeOS> store_( | 53 scoped_ptr<DeviceCloudPolicyStoreChromeOS> store_( |
53 new DeviceCloudPolicyStoreChromeOS( | 54 new DeviceCloudPolicyStoreChromeOS( |
54 &device_settings_service_, | 55 &device_settings_service_, |
55 install_attributes_.get(), | 56 install_attributes_.get(), |
56 base::ThreadTaskRunnerHandle::Get())); | 57 base::ThreadTaskRunnerHandle::Get())); |
57 fake_manager_.reset(new FakeDeviceCloudPolicyManager( | 58 fake_manager_.reset(new FakeDeviceCloudPolicyManager( |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 EXPECT_EQ(ConsumerManagementStage::UnenrollmentDMServerFailed(), | 119 EXPECT_EQ(ConsumerManagementStage::UnenrollmentDMServerFailed(), |
119 fake_service_->GetStage()); | 120 fake_service_->GetStage()); |
120 const chromeos::OwnerSettingsServiceChromeOS::ManagementSettings& settings = | 121 const chromeos::OwnerSettingsServiceChromeOS::ManagementSettings& settings = |
121 fake_owner_settings_service_->last_settings(); | 122 fake_owner_settings_service_->last_settings(); |
122 EXPECT_EQ(policy::MANAGEMENT_MODE_CONSUMER_MANAGED, settings.management_mode); | 123 EXPECT_EQ(policy::MANAGEMENT_MODE_CONSUMER_MANAGED, settings.management_mode); |
123 EXPECT_EQ("fake_request_token", settings.request_token); | 124 EXPECT_EQ("fake_request_token", settings.request_token); |
124 EXPECT_EQ("fake_device_id", settings.device_id); | 125 EXPECT_EQ("fake_device_id", settings.device_id); |
125 } | 126 } |
126 | 127 |
127 } // namespace policy | 128 } // namespace policy |
OLD | NEW |