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_management_service.h" | 5 #include "chrome/browser/chromeos/policy/consumer_management_service.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/callback.h" | 9 #include "base/callback.h" |
10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 | 105 |
106 void OnGetOwnerDone(const std::string& owner) { | 106 void OnGetOwnerDone(const std::string& owner) { |
107 owner_ = owner; | 107 owner_ = owner; |
108 } | 108 } |
109 | 109 |
110 void OnSetOwnerDone(bool status) { | 110 void OnSetOwnerDone(bool status) { |
111 set_owner_status_ = status; | 111 set_owner_status_ = status; |
112 } | 112 } |
113 | 113 |
114 NiceMock<chromeos::MockCryptohomeClient> mock_cryptohome_client_; | 114 NiceMock<chromeos::MockCryptohomeClient> mock_cryptohome_client_; |
115 scoped_ptr<ConsumerManagementService> service_; | 115 std::unique_ptr<ConsumerManagementService> service_; |
116 scoped_ptr<TestingProfileManager> testing_profile_manager_; | 116 std::unique_ptr<TestingProfileManager> testing_profile_manager_; |
117 | 117 |
118 // Variables for setting the return value or catching the arguments of mock | 118 // Variables for setting the return value or catching the arguments of mock |
119 // functions. | 119 // functions. |
120 chromeos::DBusMethodCallStatus cryptohome_status_; | 120 chromeos::DBusMethodCallStatus cryptohome_status_; |
121 bool cryptohome_result_; | 121 bool cryptohome_result_; |
122 cryptohome::BaseReply cryptohome_reply_; | 122 cryptohome::BaseReply cryptohome_reply_; |
123 cryptohome::GetBootAttributeRequest get_boot_attribute_request_; | 123 cryptohome::GetBootAttributeRequest get_boot_attribute_request_; |
124 cryptohome::SetBootAttributeRequest set_boot_attribute_request_; | 124 cryptohome::SetBootAttributeRequest set_boot_attribute_request_; |
125 std::string owner_; | 125 std::string owner_; |
126 bool set_owner_status_; | 126 bool set_owner_status_; |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 service_.GetStatus()); | 244 service_.GetStatus()); |
245 EXPECT_EQ("StatusUnenrolling", service_.GetStatusString()); | 245 EXPECT_EQ("StatusUnenrolling", service_.GetStatusString()); |
246 | 246 |
247 SetManagementMode(em::PolicyData::LOCAL_OWNER); | 247 SetManagementMode(em::PolicyData::LOCAL_OWNER); |
248 SetStageInLocalState(ConsumerManagementStage::UnenrollmentSuccess()); | 248 SetStageInLocalState(ConsumerManagementStage::UnenrollmentSuccess()); |
249 EXPECT_EQ(ConsumerManagementService::STATUS_UNENROLLED, service_.GetStatus()); | 249 EXPECT_EQ(ConsumerManagementService::STATUS_UNENROLLED, service_.GetStatus()); |
250 EXPECT_EQ("StatusUnenrolled", service_.GetStatusString()); | 250 EXPECT_EQ("StatusUnenrolled", service_.GetStatusString()); |
251 } | 251 } |
252 | 252 |
253 } // namespace policy | 253 } // namespace policy |
OLD | NEW |