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 #include "chrome/browser/sync/glue/sync_backend_host_mock.h" | 5 #include "chrome/browser/sync/glue/sync_backend_host_mock.h" |
6 | 6 |
7 #include "components/sync_driver/sync_frontend.h" | 7 #include "components/sync_driver/sync_frontend.h" |
8 | 8 |
9 namespace browser_sync { | 9 namespace browser_sync { |
10 | 10 |
11 const char kTestCacheGuid[] = "test-guid"; | |
12 | |
13 SyncBackendHostMock::SyncBackendHostMock() : fail_initial_download_(false) {} | 11 SyncBackendHostMock::SyncBackendHostMock() : fail_initial_download_(false) {} |
14 SyncBackendHostMock::~SyncBackendHostMock() {} | 12 SyncBackendHostMock::~SyncBackendHostMock() {} |
15 | 13 |
16 void SyncBackendHostMock::Initialize( | 14 void SyncBackendHostMock::Initialize( |
17 SyncFrontend* frontend, | 15 SyncFrontend* frontend, |
18 scoped_ptr<base::Thread> sync_thread, | 16 scoped_ptr<base::Thread> sync_thread, |
19 const syncer::WeakHandle<syncer::JsEventHandler>& event_handler, | 17 const syncer::WeakHandle<syncer::JsEventHandler>& event_handler, |
20 const GURL& service_url, | 18 const GURL& service_url, |
21 const syncer::SyncCredentials& credentials, | 19 const syncer::SyncCredentials& credentials, |
22 bool delete_sync_data_folder, | 20 bool delete_sync_data_folder, |
23 scoped_ptr<syncer::SyncManagerFactory> sync_manager_factory, | 21 scoped_ptr<syncer::SyncManagerFactory> sync_manager_factory, |
24 scoped_ptr<syncer::UnrecoverableErrorHandler> unrecoverable_error_handler, | 22 scoped_ptr<syncer::UnrecoverableErrorHandler> unrecoverable_error_handler, |
25 syncer::ReportUnrecoverableErrorFunction | 23 syncer::ReportUnrecoverableErrorFunction |
26 report_unrecoverable_error_function, | 24 report_unrecoverable_error_function, |
27 syncer::NetworkResources* network_resources) { | 25 syncer::NetworkResources* network_resources) { |
28 frontend->OnBackendInitialized( | 26 frontend->OnBackendInitialized( |
29 syncer::WeakHandle<syncer::JsBackend>(), | 27 syncer::WeakHandle<syncer::JsBackend>(), |
30 syncer::WeakHandle<syncer::DataTypeDebugInfoListener>(), | 28 syncer::WeakHandle<syncer::DataTypeDebugInfoListener>(), |
31 kTestCacheGuid, | |
32 !fail_initial_download_); | 29 !fail_initial_download_); |
33 } | 30 } |
34 | 31 |
35 void SyncBackendHostMock::UpdateCredentials( | 32 void SyncBackendHostMock::UpdateCredentials( |
36 const syncer::SyncCredentials& credentials) {} | 33 const syncer::SyncCredentials& credentials) {} |
37 | 34 |
38 void SyncBackendHostMock::StartSyncingWithServer() {} | 35 void SyncBackendHostMock::StartSyncingWithServer() {} |
39 | 36 |
40 void SyncBackendHostMock::SetEncryptionPassphrase( | 37 void SyncBackendHostMock::SetEncryptionPassphrase( |
41 const std::string& passphrase, | 38 const std::string& passphrase, |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 syncer::ModelTypeSet types, | 127 syncer::ModelTypeSet types, |
131 base::Callback<void(const std::vector<syncer::ModelType>& type, | 128 base::Callback<void(const std::vector<syncer::ModelType>& type, |
132 ScopedVector<base::ListValue>) > callback) {} | 129 ScopedVector<base::ListValue>) > callback) {} |
133 | 130 |
134 void SyncBackendHostMock::set_fail_initial_download(bool should_fail) { | 131 void SyncBackendHostMock::set_fail_initial_download(bool should_fail) { |
135 fail_initial_download_ = should_fail; | 132 fail_initial_download_ = should_fail; |
136 } | 133 } |
137 | 134 |
138 } // namespace browser_sync | 135 } // namespace browser_sync |
139 | 136 |
OLD | NEW |