OLD | NEW |
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 #ifndef COMPONENTS_GCM_DRIVER_FAKE_GCM_APP_HANDLER_H_ | 5 #ifndef COMPONENTS_GCM_DRIVER_FAKE_GCM_APP_HANDLER_H_ |
6 #define COMPONENTS_GCM_DRIVER_FAKE_GCM_APP_HANDLER_H_ | 6 #define COMPONENTS_GCM_DRIVER_FAKE_GCM_APP_HANDLER_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 const std::string& acked_message_id() const { return acked_message_id_; } | 34 const std::string& acked_message_id() const { return acked_message_id_; } |
35 const IncomingMessage& message() const { return message_; } | 35 const IncomingMessage& message() const { return message_; } |
36 const GCMClient::SendErrorDetails& send_error_details() const { | 36 const GCMClient::SendErrorDetails& send_error_details() const { |
37 return send_error_details_; | 37 return send_error_details_; |
38 } | 38 } |
39 | 39 |
40 void WaitForNotification(); | 40 void WaitForNotification(); |
41 | 41 |
42 // GCMAppHandler implementation. | 42 // GCMAppHandler implementation. |
43 void ShutdownHandler() override; | 43 void ShutdownHandler() override; |
| 44 void OnStoreReset() override; |
44 void OnMessage(const std::string& app_id, | 45 void OnMessage(const std::string& app_id, |
45 const IncomingMessage& message) override; | 46 const IncomingMessage& message) override; |
46 void OnMessagesDeleted(const std::string& app_id) override; | 47 void OnMessagesDeleted(const std::string& app_id) override; |
47 void OnSendError( | 48 void OnSendError( |
48 const std::string& app_id, | 49 const std::string& app_id, |
49 const GCMClient::SendErrorDetails& send_error_details) override; | 50 const GCMClient::SendErrorDetails& send_error_details) override; |
50 void OnSendAcknowledged(const std::string& app_id, | 51 void OnSendAcknowledged(const std::string& app_id, |
51 const std::string& message_id) override; | 52 const std::string& message_id) override; |
52 | 53 |
53 private: | 54 private: |
54 void ClearResults(); | 55 void ClearResults(); |
55 | 56 |
56 std::unique_ptr<base::RunLoop> run_loop_; | 57 std::unique_ptr<base::RunLoop> run_loop_; |
57 | 58 |
58 Event received_event_; | 59 Event received_event_; |
59 std::string app_id_; | 60 std::string app_id_; |
60 std::string acked_message_id_; | 61 std::string acked_message_id_; |
61 IncomingMessage message_; | 62 IncomingMessage message_; |
62 GCMClient::SendErrorDetails send_error_details_; | 63 GCMClient::SendErrorDetails send_error_details_; |
63 | 64 |
64 DISALLOW_COPY_AND_ASSIGN(FakeGCMAppHandler); | 65 DISALLOW_COPY_AND_ASSIGN(FakeGCMAppHandler); |
65 }; | 66 }; |
66 | 67 |
67 } // namespace gcm | 68 } // namespace gcm |
68 | 69 |
69 #endif // COMPONENTS_GCM_DRIVER_FAKE_GCM_APP_HANDLER_H_ | 70 #endif // COMPONENTS_GCM_DRIVER_FAKE_GCM_APP_HANDLER_H_ |
OLD | NEW |