| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "google_apis/gcm/engine/gcm_store_impl.h" | 5 #include "google_apis/gcm/engine/gcm_store_impl.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 } | 76 } |
| 77 | 77 |
| 78 GCMStoreImplTest::~GCMStoreImplTest() {} | 78 GCMStoreImplTest::~GCMStoreImplTest() {} |
| 79 | 79 |
| 80 scoped_ptr<GCMStoreImpl> GCMStoreImplTest::BuildGCMStore() { | 80 scoped_ptr<GCMStoreImpl> GCMStoreImplTest::BuildGCMStore() { |
| 81 return scoped_ptr<GCMStoreImpl>(new GCMStoreImpl( | 81 return scoped_ptr<GCMStoreImpl>(new GCMStoreImpl( |
| 82 // Pass an non-existent directory as store path to match the exact | 82 // Pass an non-existent directory as store path to match the exact |
| 83 // behavior in the production code. Currently GCMStoreImpl checks if | 83 // behavior in the production code. Currently GCMStoreImpl checks if |
| 84 // the directory exist or not to determine the store existence. | 84 // the directory exist or not to determine the store existence. |
| 85 temp_directory_.path().Append(FILE_PATH_LITERAL("GCM Store")), | 85 temp_directory_.path().Append(FILE_PATH_LITERAL("GCM Store")), |
| 86 message_loop_.message_loop_proxy(), | 86 message_loop_.task_runner(), |
| 87 make_scoped_ptr<Encryptor>(new FakeEncryptor))); | 87 make_scoped_ptr<Encryptor>(new FakeEncryptor))); |
| 88 } | 88 } |
| 89 | 89 |
| 90 void GCMStoreImplTest::LoadGCMStore( | 90 void GCMStoreImplTest::LoadGCMStore( |
| 91 GCMStoreImpl* gcm_store, scoped_ptr<GCMStore::LoadResult>* result_dst) { | 91 GCMStoreImpl* gcm_store, scoped_ptr<GCMStore::LoadResult>* result_dst) { |
| 92 gcm_store->Load( | 92 gcm_store->Load( |
| 93 GCMStore::CREATE_IF_MISSING, | 93 GCMStore::CREATE_IF_MISSING, |
| 94 base::Bind(&GCMStoreImplTest::LoadCallback, | 94 base::Bind(&GCMStoreImplTest::LoadCallback, |
| 95 base::Unretained(this), | 95 base::Unretained(this), |
| 96 result_dst)); | 96 result_dst)); |
| (...skipping 632 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 729 | 729 |
| 730 ASSERT_EQ(1u, load_result->instance_id_data.size()); | 730 ASSERT_EQ(1u, load_result->instance_id_data.size()); |
| 731 ASSERT_TRUE(load_result->instance_id_data.find(kAppName2) != | 731 ASSERT_TRUE(load_result->instance_id_data.find(kAppName2) != |
| 732 load_result->instance_id_data.end()); | 732 load_result->instance_id_data.end()); |
| 733 EXPECT_EQ(instance_id_data2, load_result->instance_id_data[kAppName2]); | 733 EXPECT_EQ(instance_id_data2, load_result->instance_id_data[kAppName2]); |
| 734 } | 734 } |
| 735 | 735 |
| 736 } // namespace | 736 } // namespace |
| 737 | 737 |
| 738 } // namespace gcm | 738 } // namespace gcm |
| OLD | NEW |