| 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_local_account_policy_service.h" | 5 #include "chrome/browser/chromeos/policy/device_local_account_policy_service.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 service_.reset(); | 152 service_.reset(); |
| 153 extension_cache_task_runner_->RunUntilIdle(); | 153 extension_cache_task_runner_->RunUntilIdle(); |
| 154 chromeos::DeviceSettingsTestBase::TearDown(); | 154 chromeos::DeviceSettingsTestBase::TearDown(); |
| 155 } | 155 } |
| 156 | 156 |
| 157 void DeviceLocalAccountPolicyServiceTestBase::CreatePolicyService() { | 157 void DeviceLocalAccountPolicyServiceTestBase::CreatePolicyService() { |
| 158 service_.reset(new DeviceLocalAccountPolicyService( | 158 service_.reset(new DeviceLocalAccountPolicyService( |
| 159 &device_settings_test_helper_, | 159 &device_settings_test_helper_, |
| 160 &device_settings_service_, | 160 &device_settings_service_, |
| 161 &cros_settings_, | 161 &cros_settings_, |
| 162 loop_.message_loop_proxy(), | 162 base::MessageLoopProxy::current(), |
| 163 extension_cache_task_runner_, | 163 extension_cache_task_runner_, |
| 164 loop_.message_loop_proxy(), | 164 base::MessageLoopProxy::current(), |
| 165 loop_.message_loop_proxy(), | 165 base::MessageLoopProxy::current(), |
| 166 new net::TestURLRequestContextGetter( | 166 new net::TestURLRequestContextGetter(base::MessageLoopProxy::current()))); |
| 167 base::MessageLoop::current()->message_loop_proxy()))); | |
| 168 } | 167 } |
| 169 | 168 |
| 170 void DeviceLocalAccountPolicyServiceTestBase:: | 169 void DeviceLocalAccountPolicyServiceTestBase:: |
| 171 InstallDeviceLocalAccountPolicy(const std::string& account_id) { | 170 InstallDeviceLocalAccountPolicy(const std::string& account_id) { |
| 172 device_local_account_policy_.policy_data().set_settings_entity_id(account_id); | 171 device_local_account_policy_.policy_data().set_settings_entity_id(account_id); |
| 173 device_local_account_policy_.policy_data().set_username(account_id); | 172 device_local_account_policy_.policy_data().set_username(account_id); |
| 174 device_local_account_policy_.Build(); | 173 device_local_account_policy_.Build(); |
| 175 device_settings_test_helper_.set_device_local_account_policy_blob( | 174 device_settings_test_helper_.set_device_local_account_policy_blob( |
| 176 account_id, device_local_account_policy_.GetBlob()); | 175 account_id, device_local_account_policy_.GetBlob()); |
| 177 } | 176 } |
| (...skipping 767 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 945 em::DeviceManagementResponse response; | 944 em::DeviceManagementResponse response; |
| 946 device_local_account_policy_.Build(); | 945 device_local_account_policy_.Build(); |
| 947 response.mutable_policy_response()->add_response()->CopyFrom( | 946 response.mutable_policy_response()->add_response()->CopyFrom( |
| 948 device_local_account_policy_.policy()); | 947 device_local_account_policy_.policy()); |
| 949 request_job->SendResponse(DM_STATUS_SUCCESS, response); | 948 request_job->SendResponse(DM_STATUS_SUCCESS, response); |
| 950 FlushDeviceSettings(); | 949 FlushDeviceSettings(); |
| 951 Mock::VerifyAndClearExpectations(&provider_observer_); | 950 Mock::VerifyAndClearExpectations(&provider_observer_); |
| 952 } | 951 } |
| 953 | 952 |
| 954 } // namespace policy | 953 } // namespace policy |
| OLD | NEW |