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

Side by Side Diff: chrome/browser/services/gcm/gcm_client_mock.cc

Issue 270873002: Extract GCMClient data types into separate gcm_types.h (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Reupload Created 6 years, 7 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "chrome/browser/services/gcm/gcm_client_mock.h" 5 #include "chrome/browser/services/gcm/gcm_client_mock.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/sys_byteorder.h" 10 #include "base/sys_byteorder.h"
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 delegate_->OnGCMReady(); 166 delegate_->OnGCMReady();
167 } 167 }
168 168
169 void GCMClientMock::RegisterFinished(const std::string& app_id, 169 void GCMClientMock::RegisterFinished(const std::string& app_id,
170 const std::string& registrion_id) { 170 const std::string& registrion_id) {
171 delegate_->OnRegisterFinished( 171 delegate_->OnRegisterFinished(
172 app_id, registrion_id, registrion_id.empty() ? SERVER_ERROR : SUCCESS); 172 app_id, registrion_id, registrion_id.empty() ? SERVER_ERROR : SUCCESS);
173 } 173 }
174 174
175 void GCMClientMock::UnregisterFinished(const std::string& app_id) { 175 void GCMClientMock::UnregisterFinished(const std::string& app_id) {
176 delegate_->OnUnregisterFinished(app_id, GCMClient::SUCCESS); 176 delegate_->OnUnregisterFinished(app_id, RESULT_SUCCESS);
177 } 177 }
178 178
179 void GCMClientMock::SendFinished(const std::string& app_id, 179 void GCMClientMock::SendFinished(const std::string& app_id,
180 const OutgoingMessage& message) { 180 const OutgoingMessage& message) {
181 delegate_->OnSendFinished(app_id, message.id, SUCCESS); 181 delegate_->OnSendFinished(app_id, message.id, SUCCESS);
182 182
183 // Simulate send error if message id contains a hint. 183 // Simulate send error if message id contains a hint.
184 if (message.id.find("error") != std::string::npos) { 184 if (message.id.find("error") != std::string::npos) {
185 SendErrorDetails send_error_details; 185 SendErrorDetails send_error_details;
186 send_error_details.message_id = message.id; 186 send_error_details.message_id = message.id;
(...skipping 15 matching lines...) Expand all
202 delegate_->OnMessageReceived(app_id, message); 202 delegate_->OnMessageReceived(app_id, message);
203 } 203 }
204 204
205 void GCMClientMock::MessagesDeleted(const std::string& app_id) { 205 void GCMClientMock::MessagesDeleted(const std::string& app_id) {
206 if (delegate_) 206 if (delegate_)
207 delegate_->OnMessagesDeleted(app_id); 207 delegate_->OnMessagesDeleted(app_id);
208 } 208 }
209 209
210 void GCMClientMock::MessageSendError( 210 void GCMClientMock::MessageSendError(
211 const std::string& app_id, 211 const std::string& app_id,
212 const GCMClient::SendErrorDetails& send_error_details) { 212 const SendErrorDetails& send_error_details) {
213 if (delegate_) 213 if (delegate_)
214 delegate_->OnMessageSendError(app_id, send_error_details); 214 delegate_->OnMessageSendError(app_id, send_error_details);
215 } 215 }
216 216
217 } // namespace gcm 217 } // namespace gcm
OLDNEW
« no previous file with comments | « chrome/browser/services/gcm/gcm_app_handler.h ('k') | chrome/browser/services/gcm/gcm_profile_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698