| 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.h" | 7 #include "base/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/settings/device_settings_service.h" | 10 #include "chrome/browser/chromeos/settings/device_settings_service.h" |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 | 123 |
| 124 void DeviceSettingsTestHelper::RequestUnlockScreen() {} | 124 void DeviceSettingsTestHelper::RequestUnlockScreen() {} |
| 125 | 125 |
| 126 void DeviceSettingsTestHelper::NotifyLockScreenDismissed() {} | 126 void DeviceSettingsTestHelper::NotifyLockScreenDismissed() {} |
| 127 | 127 |
| 128 void DeviceSettingsTestHelper::RetrieveDevicePolicy( | 128 void DeviceSettingsTestHelper::RetrieveDevicePolicy( |
| 129 const RetrievePolicyCallback& callback) { | 129 const RetrievePolicyCallback& callback) { |
| 130 device_policy_.retrieve_callbacks_.push_back(callback); | 130 device_policy_.retrieve_callbacks_.push_back(callback); |
| 131 } | 131 } |
| 132 | 132 |
| 133 void DeviceSettingsTestHelper::RetrieveUserPolicy( | 133 void DeviceSettingsTestHelper::RetrievePolicyForUser( |
| 134 const std::string& username, |
| 134 const RetrievePolicyCallback& callback) { | 135 const RetrievePolicyCallback& callback) { |
| 135 } | 136 } |
| 136 | 137 |
| 137 void DeviceSettingsTestHelper::RetrieveDeviceLocalAccountPolicy( | 138 void DeviceSettingsTestHelper::RetrieveDeviceLocalAccountPolicy( |
| 138 const std::string& account_id, | 139 const std::string& account_id, |
| 139 const RetrievePolicyCallback& callback) { | 140 const RetrievePolicyCallback& callback) { |
| 140 device_local_account_policy_[account_id].retrieve_callbacks_.push_back( | 141 device_local_account_policy_[account_id].retrieve_callbacks_.push_back( |
| 141 callback); | 142 callback); |
| 142 } | 143 } |
| 143 | 144 |
| 144 void DeviceSettingsTestHelper::StoreDevicePolicy( | 145 void DeviceSettingsTestHelper::StoreDevicePolicy( |
| 145 const std::string& policy_blob, | 146 const std::string& policy_blob, |
| 146 const StorePolicyCallback& callback) { | 147 const StorePolicyCallback& callback) { |
| 147 device_policy_.policy_blob_ = policy_blob; | 148 device_policy_.policy_blob_ = policy_blob; |
| 148 device_policy_.store_callbacks_.push_back(callback); | 149 device_policy_.store_callbacks_.push_back(callback); |
| 149 } | 150 } |
| 150 | 151 |
| 151 void DeviceSettingsTestHelper::StoreUserPolicy( | 152 void DeviceSettingsTestHelper::StorePolicyForUser( |
| 153 const std::string& username, |
| 152 const std::string& policy_blob, | 154 const std::string& policy_blob, |
| 155 const std::string& policy_key, |
| 153 const StorePolicyCallback& callback) { | 156 const StorePolicyCallback& callback) { |
| 154 } | 157 } |
| 155 | 158 |
| 156 void DeviceSettingsTestHelper::StoreDeviceLocalAccountPolicy( | 159 void DeviceSettingsTestHelper::StoreDeviceLocalAccountPolicy( |
| 157 const std::string& account_id, | 160 const std::string& account_id, |
| 158 const std::string& policy_blob, | 161 const std::string& policy_blob, |
| 159 const StorePolicyCallback& callback) { | 162 const StorePolicyCallback& callback) { |
| 160 device_local_account_policy_[account_id].policy_blob_ = policy_blob; | 163 device_local_account_policy_[account_id].policy_blob_ = policy_blob; |
| 161 device_local_account_policy_[account_id].store_callbacks_.push_back(callback); | 164 device_local_account_policy_[account_id].store_callbacks_.push_back(callback); |
| 162 } | 165 } |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 void DeviceSettingsTestBase::FlushDeviceSettings() { | 210 void DeviceSettingsTestBase::FlushDeviceSettings() { |
| 208 device_settings_test_helper_.Flush(); | 211 device_settings_test_helper_.Flush(); |
| 209 } | 212 } |
| 210 | 213 |
| 211 void DeviceSettingsTestBase::ReloadDeviceSettings() { | 214 void DeviceSettingsTestBase::ReloadDeviceSettings() { |
| 212 device_settings_service_.OwnerKeySet(true); | 215 device_settings_service_.OwnerKeySet(true); |
| 213 FlushDeviceSettings(); | 216 FlushDeviceSettings(); |
| 214 } | 217 } |
| 215 | 218 |
| 216 } // namespace chromeos | 219 } // namespace chromeos |
| OLD | NEW |