| 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 "base/prefs/pref_registry_simple.h" | 10 #include "base/prefs/pref_registry_simple.h" |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 EXPECT_EQ(ConsumerManagementService::STATUS_ENROLLING, service_.GetStatus()); | 236 EXPECT_EQ(ConsumerManagementService::STATUS_ENROLLING, service_.GetStatus()); |
| 237 EXPECT_EQ("StatusEnrolling", service_.GetStatusString()); | 237 EXPECT_EQ("StatusEnrolling", service_.GetStatusString()); |
| 238 | 238 |
| 239 SetManagementMode(em::PolicyData::CONSUMER_MANAGED); | 239 SetManagementMode(em::PolicyData::CONSUMER_MANAGED); |
| 240 SetStageInLocalState(ConsumerManagementStage( | 240 SetStageInLocalState(ConsumerManagementStage( |
| 241 ConsumerManagementStage::ENROLLMENT_SUCCESS)); | 241 ConsumerManagementStage::ENROLLMENT_SUCCESS)); |
| 242 | 242 |
| 243 EXPECT_EQ(ConsumerManagementService::STATUS_ENROLLED, service_.GetStatus()); | 243 EXPECT_EQ(ConsumerManagementService::STATUS_ENROLLED, service_.GetStatus()); |
| 244 EXPECT_EQ("StatusEnrolled", service_.GetStatusString()); | 244 EXPECT_EQ("StatusEnrolled", service_.GetStatusString()); |
| 245 | 245 |
| 246 // TODO(davidyu): Test for STATUS_UNENROLLING when it is implemented. | 246 SetStageInLocalState(ConsumerManagementStage( |
| 247 // http://crbug.com/353050. | 247 ConsumerManagementStage::UNENROLLMENT_REQUESTED)); |
| 248 EXPECT_EQ(ConsumerManagementService::STATUS_UNENROLLING, |
| 249 service_.GetStatus()); |
| 250 EXPECT_EQ("StatusUnenrolling", service_.GetStatusString()); |
| 251 |
| 252 SetManagementMode(em::PolicyData::LOCAL_OWNER); |
| 253 SetStageInLocalState(ConsumerManagementStage( |
| 254 ConsumerManagementStage::UNENROLLMENT_SUCCESS)); |
| 255 EXPECT_EQ(ConsumerManagementService::STATUS_UNENROLLED, service_.GetStatus()); |
| 256 EXPECT_EQ("StatusUnenrolled", service_.GetStatusString()); |
| 248 } | 257 } |
| 249 | 258 |
| 250 } // namespace policy | 259 } // namespace policy |
| OLD | NEW |