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

Side by Side Diff: components/gcm_driver/gcm_client_impl_unittest.cc

Issue 320993003: [GCM] Add app handler support for connection events (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 6 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 | « components/gcm_driver/gcm_client_impl.cc ('k') | components/gcm_driver/gcm_driver.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 "components/gcm_driver/gcm_client_impl.h" 5 #include "components/gcm_driver/gcm_client_impl.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/files/scoped_temp_dir.h" 8 #include "base/files/scoped_temp_dir.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 GCMClient::Result result) OVERRIDE {} 244 GCMClient::Result result) OVERRIDE {}
245 virtual void OnMessageReceived(const std::string& registration_id, 245 virtual void OnMessageReceived(const std::string& registration_id,
246 const GCMClient::IncomingMessage& message) 246 const GCMClient::IncomingMessage& message)
247 OVERRIDE; 247 OVERRIDE;
248 virtual void OnMessagesDeleted(const std::string& app_id) OVERRIDE; 248 virtual void OnMessagesDeleted(const std::string& app_id) OVERRIDE;
249 virtual void OnMessageSendError( 249 virtual void OnMessageSendError(
250 const std::string& app_id, 250 const std::string& app_id,
251 const gcm::GCMClient::SendErrorDetails& send_error_details) OVERRIDE; 251 const gcm::GCMClient::SendErrorDetails& send_error_details) OVERRIDE;
252 virtual void OnGCMReady() OVERRIDE; 252 virtual void OnGCMReady() OVERRIDE;
253 virtual void OnActivityRecorded() OVERRIDE {} 253 virtual void OnActivityRecorded() OVERRIDE {}
254 virtual void OnConnected(const net::IPEndPoint& ip_endpoint) OVERRIDE {}
255 virtual void OnDisconnected() OVERRIDE {}
254 256
255 GCMClientImpl* gcm_client() const { return gcm_client_.get(); } 257 GCMClientImpl* gcm_client() const { return gcm_client_.get(); }
256 FakeMCSClient* mcs_client() const { 258 FakeMCSClient* mcs_client() const {
257 return reinterpret_cast<FakeMCSClient*>(gcm_client_->mcs_client_.get()); 259 return reinterpret_cast<FakeMCSClient*>(gcm_client_->mcs_client_.get());
258 } 260 }
259 ConnectionFactory* connection_factory() const { 261 ConnectionFactory* connection_factory() const {
260 return gcm_client_->connection_factory_.get(); 262 return gcm_client_->connection_factory_.get();
261 } 263 }
262 264
263 void reset_last_event() { 265 void reset_last_event() {
(...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after
831 TEST_F(GCMClientImplStartAndStopTest, StartStopAndRestartImmediately) { 833 TEST_F(GCMClientImplStartAndStopTest, StartStopAndRestartImmediately) {
832 // Start the GCM and then stop and restart it immediately. 834 // Start the GCM and then stop and restart it immediately.
833 gcm_client()->Start(); 835 gcm_client()->Start();
834 gcm_client()->Stop(); 836 gcm_client()->Stop();
835 gcm_client()->Start(); 837 gcm_client()->Start();
836 838
837 PumpLoopUntilIdle(); 839 PumpLoopUntilIdle();
838 } 840 }
839 841
840 } // namespace gcm 842 } // namespace gcm
OLDNEW
« no previous file with comments | « components/gcm_driver/gcm_client_impl.cc ('k') | components/gcm_driver/gcm_driver.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698