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 #include "components/gcm_driver/fake_gcm_driver.h"
7 #include "base/files/file_path.h"
11 FakeGCMDriver::FakeGCMDriver() : GCMDriver(base::FilePath(), nullptr) {
14 FakeGCMDriver::FakeGCMDriver(
15 const scoped_refptr
<base::SequencedTaskRunner
>& blocking_task_runner
)
16 : GCMDriver(base::FilePath(), blocking_task_runner
) {
19 FakeGCMDriver::~FakeGCMDriver() {
22 void FakeGCMDriver::Shutdown() {
25 void FakeGCMDriver::AddAppHandler(
26 const std::string
& app_id
, GCMAppHandler
* handler
) {
29 void FakeGCMDriver::RemoveAppHandler(const std::string
& app_id
) {
32 void FakeGCMDriver::OnSignedIn() {
35 void FakeGCMDriver::OnSignedOut() {
38 void FakeGCMDriver::AddConnectionObserver(GCMConnectionObserver
* observer
) {
41 void FakeGCMDriver::RemoveConnectionObserver(GCMConnectionObserver
* observer
) {
44 void FakeGCMDriver::Enable() {
47 void FakeGCMDriver::Disable() {
50 GCMClient
* FakeGCMDriver::GetGCMClientForTesting() const {
54 bool FakeGCMDriver::IsStarted() const {
58 bool FakeGCMDriver::IsConnected() const {
62 void FakeGCMDriver::GetGCMStatistics(const GetGCMStatisticsCallback
& callback
,
66 void FakeGCMDriver::SetGCMRecording(const GetGCMStatisticsCallback
& callback
,
70 GCMClient::Result
FakeGCMDriver::EnsureStarted(
71 GCMClient::StartMode start_mode
) {
72 return GCMClient::SUCCESS
;
75 void FakeGCMDriver::RegisterImpl(const std::string
& app_id
,
76 const std::vector
<std::string
>& sender_ids
) {
79 void FakeGCMDriver::UnregisterImpl(const std::string
& app_id
) {
82 void FakeGCMDriver::SendImpl(const std::string
& app_id
,
83 const std::string
& receiver_id
,
84 const OutgoingMessage
& message
) {
87 void FakeGCMDriver::SetAccountTokens(
88 const std::vector
<GCMClient::AccountTokenInfo
>& account_tokens
) {
91 void FakeGCMDriver::UpdateAccountMapping(
92 const AccountMapping
& account_mapping
) {
95 void FakeGCMDriver::RemoveAccountMapping(const std::string
& account_id
) {
98 base::Time
FakeGCMDriver::GetLastTokenFetchTime() {
102 void FakeGCMDriver::SetLastTokenFetchTime(const base::Time
& time
) {
105 void FakeGCMDriver::WakeFromSuspendForHeartbeat(bool wake
) {
108 InstanceIDHandler
* FakeGCMDriver::GetInstanceIDHandler() {
112 void FakeGCMDriver::AddHeartbeatInterval(const std::string
& scope
,
116 void FakeGCMDriver::RemoveHeartbeatInterval(const std::string
& scope
) {