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(device_policy_.policy_data().username(), true); | 685 InitOwner(AccountId::FromUserEmail(device_policy_.policy_data().username()), |
| 686 true); |
686 FlushDeviceSettings(); | 687 FlushDeviceSettings(); |
687 | 688 |
688 device_policy_.policy_data().set_management_mode(em::PolicyData::LOCAL_OWNER); | 689 device_policy_.policy_data().set_management_mode(em::PolicyData::LOCAL_OWNER); |
689 device_policy_.Build(); | 690 device_policy_.Build(); |
690 device_settings_test_helper_.set_policy_blob(device_policy_.GetBlob()); | 691 device_settings_test_helper_.set_policy_blob(device_policy_.GetBlob()); |
691 ReloadDeviceSettings(); | 692 ReloadDeviceSettings(); |
692 | 693 |
693 RunTest(); | 694 RunTest(); |
694 ExpectSuccessfulEnrollment(); | 695 ExpectSuccessfulEnrollment(); |
695 } | 696 } |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
744 | 745 |
745 TEST_F(DeviceCloudPolicyManagerChromeOSEnrollmentBlankSystemSaltTest, | 746 TEST_F(DeviceCloudPolicyManagerChromeOSEnrollmentBlankSystemSaltTest, |
746 RobotRefreshSaveFailed) { | 747 RobotRefreshSaveFailed) { |
747 // Without the system salt, the robot token can't be stored. | 748 // Without the system salt, the robot token can't be stored. |
748 RunTest(); | 749 RunTest(); |
749 ExpectFailedEnrollment(EnrollmentStatus::STATUS_ROBOT_REFRESH_STORE_FAILED); | 750 ExpectFailedEnrollment(EnrollmentStatus::STATUS_ROBOT_REFRESH_STORE_FAILED); |
750 } | 751 } |
751 | 752 |
752 } // namespace | 753 } // namespace |
753 } // namespace policy | 754 } // namespace policy |
OLD | NEW |