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/settings/device_settings_test_helper.h" | 5 #include "chrome/browser/chromeos/settings/device_settings_test_helper.h" |
6 | 6 |
7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
9 #include "base/threading/sequenced_worker_pool.h" | 9 #include "base/threading/sequenced_worker_pool.h" |
10 #include "chrome/browser/chromeos/ownership/owner_settings_service_chromeos.h" | 10 #include "chrome/browser/chromeos/ownership/owner_settings_service_chromeos.h" |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 } | 90 } |
91 | 91 |
92 return false; | 92 return false; |
93 } | 93 } |
94 | 94 |
95 void DeviceSettingsTestHelper::RetrieveDevicePolicy( | 95 void DeviceSettingsTestHelper::RetrieveDevicePolicy( |
96 const RetrievePolicyCallback& callback) { | 96 const RetrievePolicyCallback& callback) { |
97 device_policy_.retrieve_callbacks_.push_back(callback); | 97 device_policy_.retrieve_callbacks_.push_back(callback); |
98 } | 98 } |
99 | 99 |
| 100 std::string DeviceSettingsTestHelper::BlockingRetrieveDevicePolicy() { |
| 101 return device_policy_.policy_blob_; |
| 102 } |
| 103 |
100 void DeviceSettingsTestHelper::RetrieveDeviceLocalAccountPolicy( | 104 void DeviceSettingsTestHelper::RetrieveDeviceLocalAccountPolicy( |
101 const std::string& account_id, | 105 const std::string& account_id, |
102 const RetrievePolicyCallback& callback) { | 106 const RetrievePolicyCallback& callback) { |
103 device_local_account_policy_[account_id].retrieve_callbacks_.push_back( | 107 device_local_account_policy_[account_id].retrieve_callbacks_.push_back( |
104 callback); | 108 callback); |
105 } | 109 } |
106 | 110 |
| 111 std::string DeviceSettingsTestHelper::BlockingRetrieveDeviceLocalAccountPolicy( |
| 112 const std::string& account_id) { |
| 113 return ""; |
| 114 } |
| 115 |
107 void DeviceSettingsTestHelper::StoreDevicePolicy( | 116 void DeviceSettingsTestHelper::StoreDevicePolicy( |
108 const std::string& policy_blob, | 117 const std::string& policy_blob, |
109 const StorePolicyCallback& callback) { | 118 const StorePolicyCallback& callback) { |
110 device_policy_.policy_blob_ = policy_blob; | 119 device_policy_.policy_blob_ = policy_blob; |
111 device_policy_.store_callbacks_.push_back(callback); | 120 device_policy_.store_callbacks_.push_back(callback); |
112 } | 121 } |
113 | 122 |
114 void DeviceSettingsTestHelper::StoreDeviceLocalAccountPolicy( | 123 void DeviceSettingsTestHelper::StoreDeviceLocalAccountPolicy( |
115 const std::string& account_id, | 124 const std::string& account_id, |
116 const std::string& policy_blob, | 125 const std::string& policy_blob, |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 const_cast<user_manager::User*>(user)); | 210 const_cast<user_manager::User*>(user)); |
202 } | 211 } |
203 OwnerSettingsServiceChromeOS* service = | 212 OwnerSettingsServiceChromeOS* service = |
204 OwnerSettingsServiceChromeOSFactory::GetForBrowserContext(profile_.get()); | 213 OwnerSettingsServiceChromeOSFactory::GetForBrowserContext(profile_.get()); |
205 CHECK(service); | 214 CHECK(service); |
206 if (tpm_is_ready) | 215 if (tpm_is_ready) |
207 service->OnTPMTokenReady(true /* token is enabled */); | 216 service->OnTPMTokenReady(true /* token is enabled */); |
208 } | 217 } |
209 | 218 |
210 } // namespace chromeos | 219 } // namespace chromeos |
OLD | NEW |