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
3 // found in the LICENSE file.
5 #ifndef COMPONENTS_GCM_DRIVER_FAKE_GCM_DRIVER_H_
6 #define COMPONENTS_GCM_DRIVER_FAKE_GCM_DRIVER_H_
8 #include "base/compiler_specific.h"
9 #include "base/macros.h"
10 #include "components/gcm_driver/gcm_driver.h"
14 class FakeGCMDriver
: public GCMDriver
{
17 virtual ~FakeGCMDriver();
19 // GCMDriver overrides:
20 virtual void Shutdown() OVERRIDE
;
21 virtual void AddAppHandler(const std::string
& app_id
,
22 GCMAppHandler
* handler
) OVERRIDE
;
23 virtual void RemoveAppHandler(const std::string
& app_id
) OVERRIDE
;
24 virtual void OnSignedIn() OVERRIDE
;
25 virtual void Purge() OVERRIDE
;
26 virtual void AddConnectionObserver(GCMConnectionObserver
* observer
) OVERRIDE
;
27 virtual void RemoveConnectionObserver(
28 GCMConnectionObserver
* observer
) OVERRIDE
;
29 virtual void Enable() OVERRIDE
;
30 virtual void Disable() OVERRIDE
;
31 virtual GCMClient
* GetGCMClientForTesting() const OVERRIDE
;
32 virtual bool IsStarted() const OVERRIDE
;
33 virtual bool IsConnected() const OVERRIDE
;
34 virtual void GetGCMStatistics(const GetGCMStatisticsCallback
& callback
,
35 bool clear_logs
) OVERRIDE
;
36 virtual void SetGCMRecording(const GetGCMStatisticsCallback
& callback
,
37 bool recording
) OVERRIDE
;
38 virtual void UpdateAccountMapping(
39 const AccountMapping
& account_mapping
) OVERRIDE
;
40 virtual void RemoveAccountMapping(const std::string
& account_id
) OVERRIDE
;
43 // GCMDriver implementation:
44 virtual GCMClient::Result
EnsureStarted() OVERRIDE
;
45 virtual void RegisterImpl(
46 const std::string
& app_id
,
47 const std::vector
<std::string
>& sender_ids
) OVERRIDE
;
48 virtual void UnregisterImpl(const std::string
& app_id
) OVERRIDE
;
49 virtual void SendImpl(const std::string
& app_id
,
50 const std::string
& receiver_id
,
51 const GCMClient::OutgoingMessage
& message
) OVERRIDE
;
54 DISALLOW_COPY_AND_ASSIGN(FakeGCMDriver
);
59 #endif // COMPONENTS_GCM_DRIVER_FAKE_GCM_DRIVER_H_