| 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 664 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 675 RunTest(); | 675 RunTest(); |
| 676 ExpectFailedEnrollment(EnrollmentStatus::STATUS_STORE_ERROR); | 676 ExpectFailedEnrollment(EnrollmentStatus::STATUS_STORE_ERROR); |
| 677 EXPECT_EQ(CloudPolicyStore::STATUS_LOAD_ERROR, | 677 EXPECT_EQ(CloudPolicyStore::STATUS_LOAD_ERROR, |
| 678 status_.store_status()); | 678 status_.store_status()); |
| 679 } | 679 } |
| 680 | 680 |
| 681 TEST_F(DeviceCloudPolicyManagerChromeOSEnrollmentTest, | 681 TEST_F(DeviceCloudPolicyManagerChromeOSEnrollmentTest, |
| 682 SuccessfulConsumerManagementEnrollment) { | 682 SuccessfulConsumerManagementEnrollment) { |
| 683 management_mode_ = MANAGEMENT_MODE_CONSUMER_MANAGED; | 683 management_mode_ = MANAGEMENT_MODE_CONSUMER_MANAGED; |
| 684 owner_key_util_->SetPrivateKey(device_policy_.GetNewSigningKey()); | 684 owner_key_util_->SetPrivateKey(device_policy_.GetNewSigningKey()); |
| 685 InitOwner(AccountId::FromUserEmail(device_policy_.policy_data().username()), | 685 InitOwner(device_policy_.policy_data().username(), true); |
| 686 true); | |
| 687 FlushDeviceSettings(); | 686 FlushDeviceSettings(); |
| 688 | 687 |
| 689 device_policy_.policy_data().set_management_mode(em::PolicyData::LOCAL_OWNER); | 688 device_policy_.policy_data().set_management_mode(em::PolicyData::LOCAL_OWNER); |
| 690 device_policy_.Build(); | 689 device_policy_.Build(); |
| 691 device_settings_test_helper_.set_policy_blob(device_policy_.GetBlob()); | 690 device_settings_test_helper_.set_policy_blob(device_policy_.GetBlob()); |
| 692 ReloadDeviceSettings(); | 691 ReloadDeviceSettings(); |
| 693 | 692 |
| 694 RunTest(); | 693 RunTest(); |
| 695 ExpectSuccessfulEnrollment(); | 694 ExpectSuccessfulEnrollment(); |
| 696 } | 695 } |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 745 | 744 |
| 746 TEST_F(DeviceCloudPolicyManagerChromeOSEnrollmentBlankSystemSaltTest, | 745 TEST_F(DeviceCloudPolicyManagerChromeOSEnrollmentBlankSystemSaltTest, |
| 747 RobotRefreshSaveFailed) { | 746 RobotRefreshSaveFailed) { |
| 748 // Without the system salt, the robot token can't be stored. | 747 // Without the system salt, the robot token can't be stored. |
| 749 RunTest(); | 748 RunTest(); |
| 750 ExpectFailedEnrollment(EnrollmentStatus::STATUS_ROBOT_REFRESH_STORE_FAILED); | 749 ExpectFailedEnrollment(EnrollmentStatus::STATUS_ROBOT_REFRESH_STORE_FAILED); |
| 751 } | 750 } |
| 752 | 751 |
| 753 } // namespace | 752 } // namespace |
| 754 } // namespace policy | 753 } // namespace policy |
| OLD | NEW |