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 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
458 // Because all adds are failing, none should hit the per-app message limits. | 458 // Because all adds are failing, none should hit the per-app message limits. |
459 EXPECT_TRUE(gcm_store->AddOutgoingMessage( | 459 EXPECT_TRUE(gcm_store->AddOutgoingMessage( |
460 base::IntToString(i), | 460 base::IntToString(i), |
461 MCSMessage(message), | 461 MCSMessage(message), |
462 base::Bind(&GCMStoreImplTest::UpdateCallback, | 462 base::Bind(&GCMStoreImplTest::UpdateCallback, |
463 base::Unretained(this)))); | 463 base::Unretained(this)))); |
464 PumpLoop(); | 464 PumpLoop(); |
465 } | 465 } |
466 } | 466 } |
467 | 467 |
| 468 TEST_F(GCMStoreImplTest, ReloadAfterClose) { |
| 469 scoped_ptr<GCMStore> gcm_store(BuildGCMStore()); |
| 470 scoped_ptr<GCMStore::LoadResult> load_result; |
| 471 gcm_store->Load(base::Bind(&GCMStoreImplTest::LoadCallback, |
| 472 base::Unretained(this), |
| 473 &load_result)); |
| 474 PumpLoop(); |
| 475 |
| 476 gcm_store->Close(); |
| 477 PumpLoop(); |
| 478 |
| 479 gcm_store->Load(base::Bind(&GCMStoreImplTest::LoadCallback, |
| 480 base::Unretained(this), |
| 481 &load_result)); |
| 482 PumpLoop(); |
| 483 } |
| 484 |
468 } // namespace | 485 } // namespace |
469 | 486 |
470 } // namespace gcm | 487 } // namespace gcm |
OLD | NEW |