summaryrefslogtreecommitdiff
path: root/chrome/browser/sync/glue/sync_backend_host_mock.cc
blob: 704f55cb3b7c4dcbd34633dd9f9b5d464ca515dd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/browser/sync/glue/sync_backend_host_mock.h"

#include "components/sync_driver/sync_frontend.h"

namespace browser_sync {

const char kTestCacheGuid[] = "test-guid";

SyncBackendHostMock::SyncBackendHostMock() : fail_initial_download_(false) {}
SyncBackendHostMock::~SyncBackendHostMock() {}

void SyncBackendHostMock::Initialize(
    sync_driver::SyncFrontend* frontend,
    scoped_ptr<base::Thread> sync_thread,
    const syncer::WeakHandle<syncer::JsEventHandler>& event_handler,
    const GURL& service_url,
    const syncer::SyncCredentials& credentials,
    bool delete_sync_data_folder,
    scoped_ptr<syncer::SyncManagerFactory> sync_manager_factory,
    scoped_ptr<syncer::UnrecoverableErrorHandler> unrecoverable_error_handler,
    syncer::ReportUnrecoverableErrorFunction
        report_unrecoverable_error_function,
    syncer::NetworkResources* network_resources) {
  frontend->OnBackendInitialized(
      syncer::WeakHandle<syncer::JsBackend>(),
      syncer::WeakHandle<syncer::DataTypeDebugInfoListener>(),
      kTestCacheGuid,
      !fail_initial_download_);
}

void SyncBackendHostMock::UpdateCredentials(
    const syncer::SyncCredentials& credentials) {}

void SyncBackendHostMock::StartSyncingWithServer() {}

void SyncBackendHostMock::SetEncryptionPassphrase(
    const std::string& passphrase,
    bool is_explicit) {}

bool SyncBackendHostMock::SetDecryptionPassphrase(
    const std::string& passphrase) {
  return false;
}

void SyncBackendHostMock::StopSyncingForShutdown() {}

scoped_ptr<base::Thread> SyncBackendHostMock::Shutdown(
    syncer::ShutdownReason reason) {
  return scoped_ptr<base::Thread>();
}

void SyncBackendHostMock::UnregisterInvalidationIds() {}

void SyncBackendHostMock::ConfigureDataTypes(
    syncer::ConfigureReason reason,
    const DataTypeConfigStateMap& config_state_map,
    const base::Callback<void(syncer::ModelTypeSet,
                              syncer::ModelTypeSet)>& ready_task,
    const base::Callback<void()>& retry_callback) {}

void SyncBackendHostMock::EnableEncryptEverything() {}

void SyncBackendHostMock::ActivateDataType(
    syncer::ModelType type, syncer::ModelSafeGroup group,
    sync_driver::ChangeProcessor* change_processor) {}
void SyncBackendHostMock::DeactivateDataType(syncer::ModelType type) {}

syncer::UserShare* SyncBackendHostMock::GetUserShare() const {
  return NULL;
}

scoped_ptr<syncer::SyncContextProxy>
SyncBackendHostMock::GetSyncContextProxy() {
  return scoped_ptr<syncer::SyncContextProxy>();
}

SyncBackendHost::Status SyncBackendHostMock::GetDetailedStatus() {
  return SyncBackendHost::Status();
}

syncer::sessions::SyncSessionSnapshot
    SyncBackendHostMock::GetLastSessionSnapshot() const {
  return syncer::sessions::SyncSessionSnapshot();
}

bool SyncBackendHostMock::HasUnsyncedItems() const {
  return false;
}

bool SyncBackendHostMock::IsNigoriEnabled() const {
 return false;
}

syncer::PassphraseType SyncBackendHostMock::GetPassphraseType() const {
  return syncer::IMPLICIT_PASSPHRASE;
}

base::Time SyncBackendHostMock::GetExplicitPassphraseTime() const {
  return base::Time();
}

bool SyncBackendHostMock::IsCryptographerReady(
    const syncer::BaseTransaction* trans) const {
  return false;
}

void SyncBackendHostMock::GetModelSafeRoutingInfo(
    syncer::ModelSafeRoutingInfo* out) const {}

base::MessageLoop* SyncBackendHostMock::GetSyncLoopForTesting() {
  return NULL;
}

void SyncBackendHostMock::RequestBufferedProtocolEventsAndEnableForwarding() {}

void SyncBackendHostMock::DisableProtocolEventForwarding() {}

void SyncBackendHostMock::EnableDirectoryTypeDebugInfoForwarding() {}

void SyncBackendHostMock::DisableDirectoryTypeDebugInfoForwarding() {}

void SyncBackendHostMock::GetAllNodesForTypes(
    syncer::ModelTypeSet types,
    base::Callback<void(const std::vector<syncer::ModelType>& type,
                        ScopedVector<base::ListValue>) > callback) {}

void SyncBackendHostMock::set_fail_initial_download(bool should_fail) {
  fail_initial_download_ = should_fail;
}

}  // namespace browser_sync