| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/cloud_external_data_manager_base.h" | 5 #include "chrome/browser/chromeos/policy/cloud_external_data_manager_base.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 } | 218 } |
| 219 | 219 |
| 220 ExternalDataFetcher::FetchCallback | 220 ExternalDataFetcher::FetchCallback |
| 221 CloudExternalDataManagerBaseTest::ConstructFetchCallback(int id) { | 221 CloudExternalDataManagerBaseTest::ConstructFetchCallback(int id) { |
| 222 return base::Bind(&CloudExternalDataManagerBaseTest::OnFetchDone, | 222 return base::Bind(&CloudExternalDataManagerBaseTest::OnFetchDone, |
| 223 base::Unretained(this), | 223 base::Unretained(this), |
| 224 id); | 224 id); |
| 225 } | 225 } |
| 226 | 226 |
| 227 void CloudExternalDataManagerBaseTest::ResetCallbackData() { | 227 void CloudExternalDataManagerBaseTest::ResetCallbackData() { |
| 228 STLDeleteValues(&callback_data_); | 228 base::STLDeleteValues(&callback_data_); |
| 229 } | 229 } |
| 230 | 230 |
| 231 void CloudExternalDataManagerBaseTest::OnFetchDone( | 231 void CloudExternalDataManagerBaseTest::OnFetchDone( |
| 232 int id, | 232 int id, |
| 233 std::unique_ptr<std::string> data) { | 233 std::unique_ptr<std::string> data) { |
| 234 delete callback_data_[id]; | 234 delete callback_data_[id]; |
| 235 callback_data_[id] = data.release(); | 235 callback_data_[id] = data.release(); |
| 236 } | 236 } |
| 237 | 237 |
| 238 void CloudExternalDataManagerBaseTest::FetchAll() { | 238 void CloudExternalDataManagerBaseTest::FetchAll() { |
| (...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 759 crypto::SHA256HashString(k10ByteData))); | 759 crypto::SHA256HashString(k10ByteData))); |
| 760 cloud_policy_store_.NotifyStoreLoaded(); | 760 cloud_policy_store_.NotifyStoreLoaded(); |
| 761 base::RunLoop().RunUntilIdle(); | 761 base::RunLoop().RunUntilIdle(); |
| 762 EXPECT_EQ(1u, callback_data_.size()); | 762 EXPECT_EQ(1u, callback_data_.size()); |
| 763 ASSERT_TRUE(callback_data_[1]); | 763 ASSERT_TRUE(callback_data_[1]); |
| 764 EXPECT_EQ(k10ByteData, *callback_data_[1]); | 764 EXPECT_EQ(k10ByteData, *callback_data_[1]); |
| 765 ResetCallbackData(); | 765 ResetCallbackData(); |
| 766 } | 766 } |
| 767 | 767 |
| 768 } // namespace policy | 768 } // namespace policy |
| OLD | NEW |