Chromium Code Reviews| 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 625 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 636 | 636 |
| 637 gcm_store->Close(); | 637 gcm_store->Close(); |
| 638 PumpLoop(); | 638 PumpLoop(); |
| 639 | 639 |
| 640 gcm_store->Load(base::Bind(&GCMStoreImplTest::LoadCallback, | 640 gcm_store->Load(base::Bind(&GCMStoreImplTest::LoadCallback, |
| 641 base::Unretained(this), | 641 base::Unretained(this), |
| 642 &load_result)); | 642 &load_result)); |
| 643 PumpLoop(); | 643 PumpLoop(); |
| 644 } | 644 } |
| 645 | 645 |
| 646 TEST_F(GCMStoreImplTest, LastTokenFetchingTime) { | |
| 647 scoped_ptr<GCMStore> gcm_store(BuildGCMStore()); | |
| 648 scoped_ptr<GCMStore::LoadResult> load_result; | |
| 649 gcm_store->Load(base::Bind( | |
| 650 &GCMStoreImplTest::LoadCallback, base::Unretained(this), &load_result)); | |
|
Nicolas Zea
2014/10/27 21:54:55
verify the initial value is unset?
fgorski
2014/10/27 23:46:27
Done.
| |
| 651 PumpLoop(); | |
| 652 | |
| 653 base::Time last_token_fetching_time = base::Time::Now(); | |
| 654 gcm_store->SetLastTokenFetchingTime( | |
| 655 last_token_fetching_time, | |
| 656 base::Bind(&GCMStoreImplTest::UpdateCallback, base::Unretained(this))); | |
| 657 PumpLoop(); | |
| 658 | |
| 659 gcm_store = BuildGCMStore().Pass(); | |
| 660 gcm_store->Load(base::Bind( | |
| 661 &GCMStoreImplTest::LoadCallback, base::Unretained(this), &load_result)); | |
| 662 PumpLoop(); | |
| 663 ASSERT_EQ(last_token_fetching_time, load_result->last_token_fetching_time); | |
| 664 } | |
| 665 | |
| 646 } // namespace | 666 } // namespace |
| 647 | 667 |
| 648 } // namespace gcm | 668 } // namespace gcm |
| OLD | NEW |