| 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_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 "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
| 10 #include "google_apis/gcm/gcm_client.h" | 10 #include "google_apis/gcm/gcm_client.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 Delegate* delegate) OVERRIDE; | 47 Delegate* delegate) OVERRIDE; |
| 48 virtual void Load() OVERRIDE; | 48 virtual void Load() OVERRIDE; |
| 49 virtual void Stop() OVERRIDE; | 49 virtual void Stop() OVERRIDE; |
| 50 virtual void CheckOut() OVERRIDE; | 50 virtual void CheckOut() OVERRIDE; |
| 51 virtual void Register(const std::string& app_id, | 51 virtual void Register(const std::string& app_id, |
| 52 const std::vector<std::string>& sender_ids) OVERRIDE; | 52 const std::vector<std::string>& sender_ids) OVERRIDE; |
| 53 virtual void Unregister(const std::string& app_id) OVERRIDE; | 53 virtual void Unregister(const std::string& app_id) OVERRIDE; |
| 54 virtual void Send(const std::string& app_id, | 54 virtual void Send(const std::string& app_id, |
| 55 const std::string& receiver_id, | 55 const std::string& receiver_id, |
| 56 const OutgoingMessage& message) OVERRIDE; | 56 const OutgoingMessage& message) OVERRIDE; |
| 57 virtual void SetRecording(bool recording) OVERRIDE; |
| 58 virtual void ClearActivityLogs() OVERRIDE; |
| 57 virtual GCMStatistics GetStatistics() const OVERRIDE; | 59 virtual GCMStatistics GetStatistics() const OVERRIDE; |
| 58 | 60 |
| 59 // Initiate the loading that has been delayed. | 61 // Initiate the loading that has been delayed. |
| 60 // Called on UI thread. | 62 // Called on UI thread. |
| 61 void PerformDelayedLoading(); | 63 void PerformDelayedLoading(); |
| 62 | 64 |
| 63 // Simulate receiving something from the server. | 65 // Simulate receiving something from the server. |
| 64 // Called on UI thread. | 66 // Called on UI thread. |
| 65 void ReceiveMessage(const std::string& app_id, | 67 void ReceiveMessage(const std::string& app_id, |
| 66 const IncomingMessage& message); | 68 const IncomingMessage& message); |
| (...skipping 22 matching lines...) Expand all Loading... |
| 89 LoadingDelay loading_delay_; | 91 LoadingDelay loading_delay_; |
| 90 ErrorSimulation error_simulation_; | 92 ErrorSimulation error_simulation_; |
| 91 base::WeakPtrFactory<GCMClientMock> weak_ptr_factory_; | 93 base::WeakPtrFactory<GCMClientMock> weak_ptr_factory_; |
| 92 | 94 |
| 93 DISALLOW_COPY_AND_ASSIGN(GCMClientMock); | 95 DISALLOW_COPY_AND_ASSIGN(GCMClientMock); |
| 94 }; | 96 }; |
| 95 | 97 |
| 96 } // namespace gcm | 98 } // namespace gcm |
| 97 | 99 |
| 98 #endif // CHROME_BROWSER_SERVICES_GCM_GCM_CLIENT_MOCK_H_ | 100 #endif // CHROME_BROWSER_SERVICES_GCM_GCM_CLIENT_MOCK_H_ |
| OLD | NEW |