Chromium Code Reviews| Index: components/gcm_driver/fake_gcm_client.h |
| diff --git a/components/gcm_driver/fake_gcm_client.h b/components/gcm_driver/fake_gcm_client.h |
| index 251b0fd5b22fe49d83ff94857fae1f775510d225..2112d86db17646df8f21628b27a7a62a63483430 100644 |
| --- a/components/gcm_driver/fake_gcm_client.h |
| +++ b/components/gcm_driver/fake_gcm_client.h |
| @@ -11,6 +11,7 @@ |
| #include "base/macros.h" |
| #include "base/memory/weak_ptr.h" |
| #include "components/gcm_driver/gcm_client.h" |
| +#include "components/gcm_driver/gcm_message_status.h" |
| #include "components/gcm_driver/gcm_stats_recorder_impl.h" |
| namespace base { |
| @@ -87,6 +88,7 @@ class FakeGCMClient : public GCMClient { |
| // Simulate receiving something from the server. |
| // Called on UI thread. |
| void ReceiveMessage(const std::string& app_id, |
| + const std::string& message_id, |
| const IncomingMessage& message); |
| void DeleteMessages(const std::string& app_id); |
| @@ -94,6 +96,10 @@ class FakeGCMClient : public GCMClient { |
| start_mode_overridding_ = overridding; |
| } |
| + const std::string& receipt_app_id() { return receipt_app_id_; } |
| + const std::string& receipt_message_id() { return receipt_message_id_; } |
| + GCMMessageStatus receipt_status() { return receipt_status_; } |
|
Peter Beverloo
2017/02/08 17:09:08
nit: these methods can be const
harkness
2017/02/09 16:27:29
Done.
|
| + |
| private: |
| // Called on IO thread. |
| void DoStart(); |
| @@ -105,12 +111,16 @@ class FakeGCMClient : public GCMClient { |
| const linked_ptr<RegistrationInfo>& registration_info); |
| void SendFinished(const std::string& app_id, const OutgoingMessage& message); |
| void MessageReceived(const std::string& app_id, |
| - const IncomingMessage& message); |
| + const IncomingMessage& message, |
| + const MessageReceiptCallback& callback); |
| void MessagesDeleted(const std::string& app_id); |
| void MessageSendError(const std::string& app_id, |
| const SendErrorDetails& send_error_details); |
| void SendAcknowledgement(const std::string& app_id, |
| const std::string& message_id); |
| + void SendMessageReceipt(const std::string& message_id, |
| + const std::string& app_id, |
| + GCMMessageStatus status); |
| Delegate* delegate_; |
| std::string product_category_for_subtypes_; |
| @@ -121,6 +131,9 @@ class FakeGCMClient : public GCMClient { |
| scoped_refptr<base::SequencedTaskRunner> io_thread_; |
| std::map<std::string, std::pair<std::string, std::string>> instance_id_data_; |
| GCMStatsRecorderImpl recorder_; |
| + std::string receipt_app_id_; |
| + std::string receipt_message_id_; |
| + GCMMessageStatus receipt_status_; |
| base::WeakPtrFactory<FakeGCMClient> weak_ptr_factory_; |
| DISALLOW_COPY_AND_ASSIGN(FakeGCMClient); |