| 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 #include "chrome/browser/services/gcm/fake_gcm_profile_service.h" | 5 #include "chrome/browser/services/gcm/fake_gcm_profile_service.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 void OnUnregisterFinished(const std::string& app_id, | 28 void OnUnregisterFinished(const std::string& app_id, |
| 29 GCMClient::Result result); | 29 GCMClient::Result result); |
| 30 void OnSendFinished(const std::string& app_id, | 30 void OnSendFinished(const std::string& app_id, |
| 31 const std::string& message_id, | 31 const std::string& message_id, |
| 32 GCMClient::Result result); | 32 GCMClient::Result result); |
| 33 | 33 |
| 34 protected: | 34 protected: |
| 35 // FakeGCMDriver overrides: | 35 // FakeGCMDriver overrides: |
| 36 virtual void RegisterImpl( | 36 virtual void RegisterImpl( |
| 37 const std::string& app_id, | 37 const std::string& app_id, |
| 38 const std::vector<std::string>& sender_ids) OVERRIDE; | 38 const std::vector<std::string>& sender_ids) override; |
| 39 virtual void UnregisterImpl(const std::string& app_id) OVERRIDE; | 39 virtual void UnregisterImpl(const std::string& app_id) override; |
| 40 virtual void SendImpl(const std::string& app_id, | 40 virtual void SendImpl(const std::string& app_id, |
| 41 const std::string& receiver_id, | 41 const std::string& receiver_id, |
| 42 const GCMClient::OutgoingMessage& message) OVERRIDE; | 42 const GCMClient::OutgoingMessage& message) override; |
| 43 | 43 |
| 44 private: | 44 private: |
| 45 FakeGCMProfileService* service_; | 45 FakeGCMProfileService* service_; |
| 46 | 46 |
| 47 DISALLOW_COPY_AND_ASSIGN(CustomFakeGCMDriver); | 47 DISALLOW_COPY_AND_ASSIGN(CustomFakeGCMDriver); |
| 48 }; | 48 }; |
| 49 | 49 |
| 50 CustomFakeGCMDriver::CustomFakeGCMDriver(FakeGCMProfileService* service) | 50 CustomFakeGCMDriver::CustomFakeGCMDriver(FakeGCMProfileService* service) |
| 51 : service_(service) { | 51 : service_(service) { |
| 52 } | 52 } |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 static_cast<CustomFakeGCMDriver*>(driver()); | 156 static_cast<CustomFakeGCMDriver*>(driver()); |
| 157 custom_driver->OnSendFinished(app_id, message.id, GCMClient::SUCCESS); | 157 custom_driver->OnSendFinished(app_id, message.id, GCMClient::SUCCESS); |
| 158 } | 158 } |
| 159 | 159 |
| 160 void FakeGCMProfileService::AddExpectedUnregisterResponse( | 160 void FakeGCMProfileService::AddExpectedUnregisterResponse( |
| 161 GCMClient::Result result) { | 161 GCMClient::Result result) { |
| 162 unregister_responses_.push_back(result); | 162 unregister_responses_.push_back(result); |
| 163 } | 163 } |
| 164 | 164 |
| 165 } // namespace gcm | 165 } // namespace gcm |
| OLD | NEW |