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

Side by Side Diff: components/invalidation/impl/gcm_invalidation_bridge_unittest.cc

Issue 2473813002: Notify GCMAppHandlers when the store is reset, so they clear cached IDs (Closed)
Patch Set: Update Cryptauth comment Created 4 years, 1 month 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
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 "components/invalidation/impl/gcm_invalidation_bridge.h" 5 #include "components/invalidation/impl/gcm_invalidation_bridge.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 token_service_->UpdateCredentials("", "fake_refresh_token"); 58 token_service_->UpdateCredentials("", "fake_refresh_token");
59 gcm_driver_.reset(new CustomFakeGCMDriver()); 59 gcm_driver_.reset(new CustomFakeGCMDriver());
60 60
61 identity_provider_.reset(new FakeIdentityProvider(token_service_.get())); 61 identity_provider_.reset(new FakeIdentityProvider(token_service_.get()));
62 bridge_.reset(new GCMInvalidationBridge(gcm_driver_.get(), 62 bridge_.reset(new GCMInvalidationBridge(gcm_driver_.get(),
63 identity_provider_.get())); 63 identity_provider_.get()));
64 64
65 delegate_ = bridge_->CreateDelegate(); 65 delegate_ = bridge_->CreateDelegate();
66 delegate_->Initialize( 66 delegate_->Initialize(
67 base::Bind(&GCMInvalidationBridgeTest::ConnectionStateChanged, 67 base::Bind(&GCMInvalidationBridgeTest::ConnectionStateChanged,
68 base::Unretained(this))); 68 base::Unretained(this)),
69 base::Bind(&base::DoNothing) /* store_reset_callback */);
69 RunLoop(); 70 RunLoop();
70 } 71 }
71 72
72 void RunLoop() { 73 void RunLoop() {
73 base::RunLoop run_loop; 74 base::RunLoop run_loop;
74 run_loop.RunUntilIdle(); 75 run_loop.RunUntilIdle();
75 } 76 }
76 77
77 public: 78 public:
78 void RegisterFinished(const std::string& registration_id, 79 void RegisterFinished(const std::string& registration_id,
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 bridge_->OnConnected(net::IPEndPoint()); 152 bridge_->OnConnected(net::IPEndPoint());
152 RunLoop(); 153 RunLoop();
153 EXPECT_TRUE(connection_online_); 154 EXPECT_TRUE(connection_online_);
154 bridge_->OnDisconnected(); 155 bridge_->OnDisconnected();
155 RunLoop(); 156 RunLoop();
156 EXPECT_FALSE(connection_online_); 157 EXPECT_FALSE(connection_online_);
157 } 158 }
158 159
159 } // namespace 160 } // namespace
160 } // namespace invalidation 161 } // namespace invalidation
OLDNEW
« no previous file with comments | « components/invalidation/impl/gcm_invalidation_bridge.cc ('k') | components/invalidation/impl/gcm_network_channel.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698