OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "sync/internal_api/public/test/fake_sync_manager.h" | 5 #include "sync/internal_api/public/test/fake_sync_manager.h" |
6 | 6 |
7 #include <cstddef> | 7 #include <cstddef> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
11 #include "base/location.h" | 11 #include "base/location.h" |
12 #include "base/logging.h" | 12 #include "base/logging.h" |
13 #include "base/run_loop.h" | 13 #include "base/run_loop.h" |
14 #include "base/sequenced_task_runner.h" | 14 #include "base/sequenced_task_runner.h" |
15 #include "base/single_thread_task_runner.h" | 15 #include "base/single_thread_task_runner.h" |
16 #include "base/thread_task_runner_handle.h" | 16 #include "base/thread_task_runner_handle.h" |
17 #include "sync/internal_api/public/http_post_provider_factory.h" | 17 #include "sync/internal_api/public/http_post_provider_factory.h" |
18 #include "sync/internal_api/public/internal_components_factory.h" | 18 #include "sync/internal_api/public/internal_components_factory.h" |
19 #include "sync/internal_api/public/util/weak_handle.h" | 19 #include "sync/internal_api/public/util/weak_handle.h" |
20 #include "sync/syncable/directory.h" | 20 #include "sync/syncable/directory.h" |
21 #include "sync/test/fake_sync_encryption_handler.h" | 21 #include "sync/test/fake_sync_encryption_handler.h" |
22 | 22 |
| 23 class GURL; |
| 24 |
23 namespace syncer { | 25 namespace syncer { |
24 | 26 |
25 FakeSyncManager::FakeSyncManager(ModelTypeSet initial_sync_ended_types, | 27 FakeSyncManager::FakeSyncManager(ModelTypeSet initial_sync_ended_types, |
26 ModelTypeSet progress_marker_types, | 28 ModelTypeSet progress_marker_types, |
27 ModelTypeSet configure_fail_types) : | 29 ModelTypeSet configure_fail_types) : |
28 initial_sync_ended_types_(initial_sync_ended_types), | 30 initial_sync_ended_types_(initial_sync_ended_types), |
29 progress_marker_types_(progress_marker_types), | 31 progress_marker_types_(progress_marker_types), |
30 configure_fail_types_(configure_fail_types), | 32 configure_fail_types_(configure_fail_types), |
31 last_configure_reason_(CONFIGURE_REASON_UNKNOWN) { | 33 last_configure_reason_(CONFIGURE_REASON_UNKNOWN) { |
32 fake_encryption_handler_.reset(new FakeSyncEncryptionHandler()); | 34 fake_encryption_handler_.reset(new FakeSyncEncryptionHandler()); |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 base::Bind(&base::DoNothing), | 68 base::Bind(&base::DoNothing), |
67 run_loop.QuitClosure())) { | 69 run_loop.QuitClosure())) { |
68 NOTREACHED(); | 70 NOTREACHED(); |
69 } | 71 } |
70 run_loop.Run(); | 72 run_loop.Run(); |
71 } | 73 } |
72 | 74 |
73 void FakeSyncManager::Init( | 75 void FakeSyncManager::Init( |
74 const base::FilePath& database_location, | 76 const base::FilePath& database_location, |
75 const WeakHandle<JsEventHandler>& event_handler, | 77 const WeakHandle<JsEventHandler>& event_handler, |
76 const std::string& sync_server_and_path, | 78 const GURL& service_url, |
77 int sync_server_port, | |
78 bool use_ssl, | |
79 scoped_ptr<HttpPostProviderFactory> post_factory, | 79 scoped_ptr<HttpPostProviderFactory> post_factory, |
80 const std::vector<scoped_refptr<ModelSafeWorker> >& workers, | 80 const std::vector<scoped_refptr<ModelSafeWorker> >& workers, |
81 ExtensionsActivity* extensions_activity, | 81 ExtensionsActivity* extensions_activity, |
82 ChangeDelegate* change_delegate, | 82 ChangeDelegate* change_delegate, |
83 const SyncCredentials& credentials, | 83 const SyncCredentials& credentials, |
84 const std::string& invalidator_client_id, | 84 const std::string& invalidator_client_id, |
85 const std::string& restored_key_for_bootstrapping, | 85 const std::string& restored_key_for_bootstrapping, |
86 const std::string& restored_keystore_key_for_bootstrapping, | 86 const std::string& restored_keystore_key_for_bootstrapping, |
87 InternalComponentsFactory* internal_components_factory, | 87 InternalComponentsFactory* internal_components_factory, |
88 Encryptor* encryptor, | 88 Encryptor* encryptor, |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 | 267 |
268 ModelTypeSet FakeSyncManager::GetLastRefreshRequestTypes() { | 268 ModelTypeSet FakeSyncManager::GetLastRefreshRequestTypes() { |
269 return last_refresh_request_types_; | 269 return last_refresh_request_types_; |
270 } | 270 } |
271 | 271 |
272 void FakeSyncManager::SetInvalidatorEnabled(bool invalidator_enabled) { | 272 void FakeSyncManager::SetInvalidatorEnabled(bool invalidator_enabled) { |
273 // Do nothing. | 273 // Do nothing. |
274 } | 274 } |
275 | 275 |
276 } // namespace syncer | 276 } // namespace syncer |
OLD | NEW |