| OLD | NEW |
| 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_FAKE_GCM_PROFILE_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_SERVICES_GCM_FAKE_GCM_PROFILE_SERVICE_H_ |
| 6 #define CHROME_BROWSER_SERVICES_GCM_FAKE_GCM_PROFILE_SERVICE_H_ | 6 #define CHROME_BROWSER_SERVICES_GCM_FAKE_GCM_PROFILE_SERVICE_H_ |
| 7 | 7 |
| 8 #include "chrome/browser/services/gcm/gcm_profile_service.h" | 8 #include "chrome/browser/services/gcm/gcm_profile_service.h" |
| 9 | 9 |
| 10 namespace content { | 10 namespace content { |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 virtual ~FakeGCMProfileService(); | 24 virtual ~FakeGCMProfileService(); |
| 25 | 25 |
| 26 // GCMProfileService overrides. | 26 // GCMProfileService overrides. |
| 27 virtual void Register(const std::string& app_id, | 27 virtual void Register(const std::string& app_id, |
| 28 const std::vector<std::string>& sender_ids, | 28 const std::vector<std::string>& sender_ids, |
| 29 RegisterCallback callback) OVERRIDE; | 29 RegisterCallback callback) OVERRIDE; |
| 30 virtual void Unregister(const std::string& app_id, | 30 virtual void Unregister(const std::string& app_id, |
| 31 UnregisterCallback callback) OVERRIDE; | 31 UnregisterCallback callback) OVERRIDE; |
| 32 virtual void Send(const std::string& app_id, | 32 virtual void Send(const std::string& app_id, |
| 33 const std::string& receiver_id, | 33 const std::string& receiver_id, |
| 34 const GCMClient::OutgoingMessage& message, | 34 const OutgoingMessage& message, |
| 35 SendCallback callback) OVERRIDE; | 35 SendCallback callback) OVERRIDE; |
| 36 | 36 |
| 37 void RegisterFinished(const std::string& app_id, | 37 void RegisterFinished(const std::string& app_id, |
| 38 const std::vector<std::string>& sender_ids, | 38 const std::vector<std::string>& sender_ids, |
| 39 RegisterCallback callback); | 39 RegisterCallback callback); |
| 40 | 40 |
| 41 void SendFinished(const std::string& app_id, | 41 void SendFinished(const std::string& app_id, |
| 42 const std::string& receiver_id, | 42 const std::string& receiver_id, |
| 43 const GCMClient::OutgoingMessage& message, | 43 const OutgoingMessage& message, |
| 44 SendCallback callback); | 44 SendCallback callback); |
| 45 | 45 |
| 46 void AddExpectedUnregisterResponse(GCMClient::Result result); | 46 void AddExpectedUnregisterResponse(Result result); |
| 47 GCMClient::Result GetNextExpectedUnregisterResponse(); | 47 Result GetNextExpectedUnregisterResponse(); |
| 48 | 48 |
| 49 const GCMClient::OutgoingMessage& last_sent_message() const { | 49 const OutgoingMessage& last_sent_message() const { |
| 50 return last_sent_message_; | 50 return last_sent_message_; |
| 51 } | 51 } |
| 52 | 52 |
| 53 const std::string& last_receiver_id() const { | 53 const std::string& last_receiver_id() const { |
| 54 return last_receiver_id_; | 54 return last_receiver_id_; |
| 55 } | 55 } |
| 56 | 56 |
| 57 const std::string& last_registered_app_id() const { | 57 const std::string& last_registered_app_id() const { |
| 58 return last_registered_app_id_; | 58 return last_registered_app_id_; |
| 59 } | 59 } |
| 60 | 60 |
| 61 const std::vector<std::string>& last_registered_sender_ids() const { | 61 const std::vector<std::string>& last_registered_sender_ids() const { |
| 62 return last_registered_sender_ids_; | 62 return last_registered_sender_ids_; |
| 63 } | 63 } |
| 64 | 64 |
| 65 void set_collect(bool collect) { | 65 void set_collect(bool collect) { |
| 66 collect_ = collect; | 66 collect_ = collect; |
| 67 } | 67 } |
| 68 | 68 |
| 69 private: | 69 private: |
| 70 // Indicates whether the serivce will collect paramters of the calls for | 70 // Indicates whether the serivce will collect paramters of the calls for |
| 71 // furter verification in tests. | 71 // furter verification in tests. |
| 72 bool collect_; | 72 bool collect_; |
| 73 std::string last_registered_app_id_; | 73 std::string last_registered_app_id_; |
| 74 std::vector<std::string> last_registered_sender_ids_; | 74 std::vector<std::string> last_registered_sender_ids_; |
| 75 std::vector<GCMClient::Result> unregister_responses_; | 75 std::vector<Result> unregister_responses_; |
| 76 GCMClient::OutgoingMessage last_sent_message_; | 76 OutgoingMessage last_sent_message_; |
| 77 std::string last_receiver_id_; | 77 std::string last_receiver_id_; |
| 78 | 78 |
| 79 DISALLOW_COPY_AND_ASSIGN(FakeGCMProfileService); | 79 DISALLOW_COPY_AND_ASSIGN(FakeGCMProfileService); |
| 80 }; | 80 }; |
| 81 | 81 |
| 82 } // namespace gcm | 82 } // namespace gcm |
| 83 | 83 |
| 84 #endif // CHROME_BROWSER_SERVICES_GCM_FAKE_GCM_PROFILE_SERVICE_H_ | 84 #endif // CHROME_BROWSER_SERVICES_GCM_FAKE_GCM_PROFILE_SERVICE_H_ |
| OLD | NEW |