| 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 <stdint.h> |
| 8 |
| 7 #include <algorithm> | 9 #include <algorithm> |
| 8 | 10 |
| 9 #include "base/basictypes.h" | |
| 10 #include "base/bind.h" | 11 #include "base/bind.h" |
| 11 #include "base/bind_helpers.h" | 12 #include "base/bind_helpers.h" |
| 12 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
| 14 #include "base/macros.h" |
| 13 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
| 14 #include "base/prefs/pref_registry_simple.h" | 16 #include "base/prefs/pref_registry_simple.h" |
| 15 #include "base/prefs/testing_pref_service.h" | 17 #include "base/prefs/testing_pref_service.h" |
| 16 #include "base/run_loop.h" | 18 #include "base/run_loop.h" |
| 17 #include "base/thread_task_runner_handle.h" | 19 #include "base/thread_task_runner_handle.h" |
| 18 #include "chrome/browser/chromeos/ownership/owner_settings_service_chromeos.h" | 20 #include "chrome/browser/chromeos/ownership/owner_settings_service_chromeos.h" |
| 19 #include "chrome/browser/chromeos/ownership/owner_settings_service_chromeos_fact
ory.h" | 21 #include "chrome/browser/chromeos/ownership/owner_settings_service_chromeos_fact
ory.h" |
| 20 #include "chrome/browser/chromeos/policy/device_cloud_policy_initializer.h" | 22 #include "chrome/browser/chromeos/policy/device_cloud_policy_initializer.h" |
| 21 #include "chrome/browser/chromeos/policy/device_cloud_policy_store_chromeos.h" | 23 #include "chrome/browser/chromeos/policy/device_cloud_policy_store_chromeos.h" |
| 22 #include "chrome/browser/chromeos/policy/enrollment_config.h" | 24 #include "chrome/browser/chromeos/policy/enrollment_config.h" |
| (...skipping 709 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 732 &DeviceCloudPolicyManagerChromeOSEnrollmentTest::OnUnregistered, | 734 &DeviceCloudPolicyManagerChromeOSEnrollmentTest::OnUnregistered, |
| 733 base::Unretained(this))); | 735 base::Unretained(this))); |
| 734 } | 736 } |
| 735 | 737 |
| 736 // A subclass that runs with a blank system salt. | 738 // A subclass that runs with a blank system salt. |
| 737 class DeviceCloudPolicyManagerChromeOSEnrollmentBlankSystemSaltTest | 739 class DeviceCloudPolicyManagerChromeOSEnrollmentBlankSystemSaltTest |
| 738 : public DeviceCloudPolicyManagerChromeOSEnrollmentTest { | 740 : public DeviceCloudPolicyManagerChromeOSEnrollmentTest { |
| 739 protected: | 741 protected: |
| 740 DeviceCloudPolicyManagerChromeOSEnrollmentBlankSystemSaltTest() { | 742 DeviceCloudPolicyManagerChromeOSEnrollmentBlankSystemSaltTest() { |
| 741 // Set up a FakeCryptohomeClient with a blank system salt. | 743 // Set up a FakeCryptohomeClient with a blank system salt. |
| 742 fake_cryptohome_client_->set_system_salt(std::vector<uint8>()); | 744 fake_cryptohome_client_->set_system_salt(std::vector<uint8_t>()); |
| 743 } | 745 } |
| 744 }; | 746 }; |
| 745 | 747 |
| 746 TEST_F(DeviceCloudPolicyManagerChromeOSEnrollmentBlankSystemSaltTest, | 748 TEST_F(DeviceCloudPolicyManagerChromeOSEnrollmentBlankSystemSaltTest, |
| 747 RobotRefreshSaveFailed) { | 749 RobotRefreshSaveFailed) { |
| 748 // Without the system salt, the robot token can't be stored. | 750 // Without the system salt, the robot token can't be stored. |
| 749 RunTest(); | 751 RunTest(); |
| 750 ExpectFailedEnrollment(EnrollmentStatus::STATUS_ROBOT_REFRESH_STORE_FAILED); | 752 ExpectFailedEnrollment(EnrollmentStatus::STATUS_ROBOT_REFRESH_STORE_FAILED); |
| 751 } | 753 } |
| 752 | 754 |
| 753 } // namespace | 755 } // namespace |
| 754 } // namespace policy | 756 } // namespace policy |
| OLD | NEW |