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

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

Issue 98173009: GCM Checkin implementation with unit tests and protobufs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@gcm-store
Patch Set: Renaming fields, class names and files, updating gyp file. Created 6 years, 11 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
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 #ifndef CHROME_BROWSER_SERVICES_GCM_GCM_CLIENT_MOCK_H_ 5 #ifndef CHROME_BROWSER_SERVICES_GCM_GCM_CLIENT_MOCK_H_
6 #define CHROME_BROWSER_SERVICES_GCM_GCM_CLIENT_MOCK_H_ 6 #define CHROME_BROWSER_SERVICES_GCM_GCM_CLIENT_MOCK_H_
7 7
8 #include <map> 8 #include <map>
9 9
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 29 matching lines...) Expand all
40 const std::string& app_id, 40 const std::string& app_id,
41 const IncomingMessage& message); 41 const IncomingMessage& message);
42 void DeleteMessages(const std::string& username, const std::string& app_id); 42 void DeleteMessages(const std::string& username, const std::string& app_id);
43 43
44 void set_simulate_server_error(bool simulate_server_error) { 44 void set_simulate_server_error(bool simulate_server_error) {
45 simulate_server_error_ = simulate_server_error; 45 simulate_server_error_ = simulate_server_error;
46 } 46 }
47 47
48 void SetIsLoading(bool is_loading); 48 void SetIsLoading(bool is_loading);
49 49
50 static CheckInInfo GetCheckInInfoFromUsername(const std::string& username); 50 static CheckinInfo GetCheckinInfoFromUsername(const std::string& username);
51 static std::string GetRegistrationIdFromSenderIds( 51 static std::string GetRegistrationIdFromSenderIds(
52 const std::vector<std::string>& sender_ids); 52 const std::vector<std::string>& sender_ids);
53 53
54 private: 54 private:
55 Delegate* GetDelegate(const std::string& username) const; 55 Delegate* GetDelegate(const std::string& username) const;
56 56
57 // Called on IO thread. 57 // Called on IO thread.
58 void CheckInFinished(std::string username, CheckInInfo checkin_info); 58 void CheckInFinished(std::string username, CheckinInfo checkin_info);
Nicolas Zea 2014/01/07 00:41:52 nit: this, and all these other params should be pa
fgorski 2014/01/07 23:46:44 Added a TODO
59 void RegisterFinished(std::string username, 59 void RegisterFinished(std::string username,
60 std::string app_id, 60 std::string app_id,
61 std::string registrion_id); 61 std::string registrion_id);
62 void SendFinished(std::string username, 62 void SendFinished(std::string username,
63 std::string app_id, 63 std::string app_id,
64 std::string message_id); 64 std::string message_id);
65 void MessageReceived(std::string username, 65 void MessageReceived(std::string username,
66 std::string app_id, 66 std::string app_id,
67 IncomingMessage message); 67 IncomingMessage message);
68 void MessagesDeleted(std::string username, std::string app_id); 68 void MessagesDeleted(std::string username, std::string app_id);
69 void MessageSendError(std::string username, 69 void MessageSendError(std::string username,
70 std::string app_id, 70 std::string app_id,
71 std::string message_id); 71 std::string message_id);
72 void LoadingCompleted(); 72 void LoadingCompleted();
73 73
74 std::map<std::string, Delegate*> delegates_; 74 std::map<std::string, Delegate*> delegates_;
75 75
76 bool is_loading_; 76 bool is_loading_;
77 77
78 // The testing code could set this to simulate the server error in order to 78 // The testing code could set this to simulate the server error in order to
79 // test the error scenario. 79 // test the error scenario.
80 bool simulate_server_error_; 80 bool simulate_server_error_;
81 81
82 DISALLOW_COPY_AND_ASSIGN(GCMClientMock); 82 DISALLOW_COPY_AND_ASSIGN(GCMClientMock);
83 }; 83 };
84 84
85 } // namespace gcm 85 } // namespace gcm
86 86
87 #endif // CHROME_BROWSER_SERVICES_GCM_GCM_CLIENT_MOCK_H_ 87 #endif // CHROME_BROWSER_SERVICES_GCM_GCM_CLIENT_MOCK_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/services/gcm/gcm_client_mock.cc » ('j') | chrome/browser/services/gcm/gcm_profile_service.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698