| 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 <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 EXPECT_TRUE(temp_directory_.CreateUniqueTempDir()); | 81 EXPECT_TRUE(temp_directory_.CreateUniqueTempDir()); |
| 82 } | 82 } |
| 83 | 83 |
| 84 GCMStoreImplTest::~GCMStoreImplTest() {} | 84 GCMStoreImplTest::~GCMStoreImplTest() {} |
| 85 | 85 |
| 86 std::unique_ptr<GCMStoreImpl> GCMStoreImplTest::BuildGCMStore() { | 86 std::unique_ptr<GCMStoreImpl> GCMStoreImplTest::BuildGCMStore() { |
| 87 return std::unique_ptr<GCMStoreImpl>(new GCMStoreImpl( | 87 return std::unique_ptr<GCMStoreImpl>(new GCMStoreImpl( |
| 88 // Pass an non-existent directory as store path to match the exact | 88 // Pass an non-existent directory as store path to match the exact |
| 89 // behavior in the production code. Currently GCMStoreImpl checks if | 89 // behavior in the production code. Currently GCMStoreImpl checks if |
| 90 // the directory exist or not to determine the store existence. | 90 // the directory exist or not to determine the store existence. |
| 91 temp_directory_.path().Append(FILE_PATH_LITERAL("GCM Store")), | 91 temp_directory_.GetPath().Append(FILE_PATH_LITERAL("GCM Store")), |
| 92 task_runner_, base::WrapUnique<Encryptor>(new FakeEncryptor))); | 92 task_runner_, base::WrapUnique<Encryptor>(new FakeEncryptor))); |
| 93 } | 93 } |
| 94 | 94 |
| 95 void GCMStoreImplTest::LoadGCMStore( | 95 void GCMStoreImplTest::LoadGCMStore( |
| 96 GCMStoreImpl* gcm_store, | 96 GCMStoreImpl* gcm_store, |
| 97 std::unique_ptr<GCMStore::LoadResult>* result_dst) { | 97 std::unique_ptr<GCMStore::LoadResult>* result_dst) { |
| 98 gcm_store->Load( | 98 gcm_store->Load( |
| 99 GCMStore::CREATE_IF_MISSING, | 99 GCMStore::CREATE_IF_MISSING, |
| 100 base::Bind(&GCMStoreImplTest::LoadCallback, | 100 base::Bind(&GCMStoreImplTest::LoadCallback, |
| 101 base::Unretained(this), | 101 base::Unretained(this), |
| (...skipping 631 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 733 | 733 |
| 734 ASSERT_EQ(1u, load_result->instance_id_data.size()); | 734 ASSERT_EQ(1u, load_result->instance_id_data.size()); |
| 735 ASSERT_TRUE(load_result->instance_id_data.find(kAppName2) != | 735 ASSERT_TRUE(load_result->instance_id_data.find(kAppName2) != |
| 736 load_result->instance_id_data.end()); | 736 load_result->instance_id_data.end()); |
| 737 EXPECT_EQ(instance_id_data2, load_result->instance_id_data[kAppName2]); | 737 EXPECT_EQ(instance_id_data2, load_result->instance_id_data[kAppName2]); |
| 738 } | 738 } |
| 739 | 739 |
| 740 } // namespace | 740 } // namespace |
| 741 | 741 |
| 742 } // namespace gcm | 742 } // namespace gcm |
| OLD | NEW |