| 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 25 matching lines...) Expand all Loading... |
| 36 | 36 |
| 37 // Category name for testing. | 37 // Category name for testing. |
| 38 const char kCategoryName[] = "my_category"; | 38 const char kCategoryName[] = "my_category"; |
| 39 | 39 |
| 40 const uint64 kDeviceId = 22; | 40 const uint64 kDeviceId = 22; |
| 41 const uint64 kDeviceToken = 55; | 41 const uint64 kDeviceToken = 55; |
| 42 | 42 |
| 43 class GCMStoreImplTest : public testing::Test { | 43 class GCMStoreImplTest : public testing::Test { |
| 44 public: | 44 public: |
| 45 GCMStoreImplTest(); | 45 GCMStoreImplTest(); |
| 46 virtual ~GCMStoreImplTest(); | 46 ~GCMStoreImplTest() override; |
| 47 | 47 |
| 48 scoped_ptr<GCMStore> BuildGCMStore(); | 48 scoped_ptr<GCMStore> BuildGCMStore(); |
| 49 | 49 |
| 50 std::string GetNextPersistentId(); | 50 std::string GetNextPersistentId(); |
| 51 | 51 |
| 52 void PumpLoop(); | 52 void PumpLoop(); |
| 53 | 53 |
| 54 void LoadCallback(scoped_ptr<GCMStore::LoadResult>* result_dst, | 54 void LoadCallback(scoped_ptr<GCMStore::LoadResult>* result_dst, |
| 55 scoped_ptr<GCMStore::LoadResult> result); | 55 scoped_ptr<GCMStore::LoadResult> result); |
| 56 void UpdateCallback(bool success); | 56 void UpdateCallback(bool success); |
| (...skipping 603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 660 gcm_store = BuildGCMStore().Pass(); | 660 gcm_store = BuildGCMStore().Pass(); |
| 661 gcm_store->Load(base::Bind( | 661 gcm_store->Load(base::Bind( |
| 662 &GCMStoreImplTest::LoadCallback, base::Unretained(this), &load_result)); | 662 &GCMStoreImplTest::LoadCallback, base::Unretained(this), &load_result)); |
| 663 PumpLoop(); | 663 PumpLoop(); |
| 664 EXPECT_EQ(last_token_fetch_time, load_result->last_token_fetch_time); | 664 EXPECT_EQ(last_token_fetch_time, load_result->last_token_fetch_time); |
| 665 } | 665 } |
| 666 | 666 |
| 667 } // namespace | 667 } // namespace |
| 668 | 668 |
| 669 } // namespace gcm | 669 } // namespace gcm |
| OLD | NEW |