Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(427)

Side by Side Diff: google_apis/gcm/engine/gcm_store_impl_unittest.cc

Issue 183013007: [GCM] Stop/restart GCM when the state is forced off/on (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Patch to land Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « google_apis/gcm/engine/gcm_store_impl.cc ('k') | google_apis/gcm/gcm_client.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « google_apis/gcm/engine/gcm_store_impl.cc ('k') | google_apis/gcm/gcm_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698