[AndroidWebViewShell] Replace rebaseline script with a new version using test_runner.py
[chromium-blink-merge.git] / components / gcm_driver / fake_gcm_driver.h
blob8aa19da0a9e98b3a1b705c38e96d0e2af304dcde
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"
12 namespace gcm {
14 class FakeGCMDriver : public GCMDriver {
15 public:
16 FakeGCMDriver();
17 ~FakeGCMDriver() override;
19 // GCMDriver overrides:
20 void Shutdown() override;
21 void AddAppHandler(const std::string& app_id,
22 GCMAppHandler* handler) override;
23 void RemoveAppHandler(const std::string& app_id) override;
24 void OnSignedIn() override;
25 void OnSignedOut() override;
26 void AddConnectionObserver(GCMConnectionObserver* observer) override;
27 void RemoveConnectionObserver(GCMConnectionObserver* observer) override;
28 void Enable() override;
29 void Disable() override;
30 GCMClient* GetGCMClientForTesting() const override;
31 bool IsStarted() const override;
32 bool IsConnected() const override;
33 void GetGCMStatistics(const GetGCMStatisticsCallback& callback,
34 bool clear_logs) override;
35 void SetGCMRecording(const GetGCMStatisticsCallback& callback,
36 bool recording) override;
37 void SetAccountTokens(
38 const std::vector<GCMClient::AccountTokenInfo>& account_tokens) override;
39 void UpdateAccountMapping(const AccountMapping& account_mapping) override;
40 void RemoveAccountMapping(const std::string& account_id) override;
41 base::Time GetLastTokenFetchTime() override;
42 void SetLastTokenFetchTime(const base::Time& time) override;
43 void WakeFromSuspendForHeartbeat(bool wake) override;
44 InstanceIDHandler* GetInstanceIDHandler() override;
45 void AddHeartbeatInterval(const std::string& scope, int interval_ms) override;
46 void RemoveHeartbeatInterval(const std::string& scope) override;
48 protected:
49 // GCMDriver implementation:
50 GCMClient::Result EnsureStarted(
51 GCMClient::StartMode start_mode) override;
52 void RegisterImpl(const std::string& app_id,
53 const std::vector<std::string>& sender_ids) override;
54 void UnregisterImpl(const std::string& app_id) override;
55 void SendImpl(const std::string& app_id,
56 const std::string& receiver_id,
57 const OutgoingMessage& message) override;
59 private:
60 DISALLOW_COPY_AND_ASSIGN(FakeGCMDriver);
63 } // namespace gcm
65 #endif // COMPONENTS_GCM_DRIVER_FAKE_GCM_DRIVER_H_