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 "components/sync/core/test/fake_sync_manager.h" | 5 #include "components/sync/engine/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/memory/ptr_util.h" | 13 #include "base/memory/ptr_util.h" |
14 #include "base/run_loop.h" | 14 #include "base/run_loop.h" |
15 #include "base/sequenced_task_runner.h" | 15 #include "base/sequenced_task_runner.h" |
16 #include "base/single_thread_task_runner.h" | 16 #include "base/single_thread_task_runner.h" |
17 #include "base/threading/thread_task_runner_handle.h" | 17 #include "base/threading/thread_task_runner_handle.h" |
18 #include "components/sync/base/weak_handle.h" | 18 #include "components/sync/base/weak_handle.h" |
19 #include "components/sync/core/internal_components_factory.h" | 19 #include "components/sync/engine/engine_components_factory.h" |
20 #include "components/sync/core/test/fake_model_type_connector.h" | 20 #include "components/sync/engine/fake_model_type_connector.h" |
21 #include "components/sync/engine/net/http_post_provider_factory.h" | 21 #include "components/sync/engine/net/http_post_provider_factory.h" |
22 #include "components/sync/syncable/directory.h" | 22 #include "components/sync/syncable/directory.h" |
23 #include "components/sync/test/fake_sync_encryption_handler.h" | 23 #include "components/sync/test/fake_sync_encryption_handler.h" |
24 | 24 |
25 class GURL; | 25 class GURL; |
26 | 26 |
27 namespace syncer { | 27 namespace syncer { |
28 | 28 |
29 FakeSyncManager::FakeSyncManager(ModelTypeSet initial_sync_ended_types, | 29 FakeSyncManager::FakeSyncManager(ModelTypeSet initial_sync_ended_types, |
30 ModelTypeSet progress_marker_types, | 30 ModelTypeSet progress_marker_types, |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 sync_task_runner_ = base::ThreadTaskRunnerHandle::Get(); | 81 sync_task_runner_ = base::ThreadTaskRunnerHandle::Get(); |
82 PurgePartiallySyncedTypes(); | 82 PurgePartiallySyncedTypes(); |
83 | 83 |
84 test_user_share_.SetUp(); | 84 test_user_share_.SetUp(); |
85 UserShare* share = test_user_share_.user_share(); | 85 UserShare* share = test_user_share_.user_share(); |
86 for (ModelTypeSet::Iterator it = initial_sync_ended_types_.First(); it.Good(); | 86 for (ModelTypeSet::Iterator it = initial_sync_ended_types_.First(); it.Good(); |
87 it.Inc()) { | 87 it.Inc()) { |
88 TestUserShare::CreateRoot(it.Get(), share); | 88 TestUserShare::CreateRoot(it.Get(), share); |
89 } | 89 } |
90 | 90 |
91 FOR_EACH_OBSERVER( | 91 for (auto& observer : observers_) { |
92 SyncManager::Observer, observers_, | 92 observer.OnInitializationComplete(WeakHandle<JsBackend>(), |
93 OnInitializationComplete(WeakHandle<JsBackend>(), | 93 WeakHandle<DataTypeDebugInfoListener>(), |
94 WeakHandle<DataTypeDebugInfoListener>(), true, | 94 true, initial_sync_ended_types_); |
95 initial_sync_ended_types_)); | 95 } |
96 } | 96 } |
97 | 97 |
98 ModelTypeSet FakeSyncManager::InitialSyncEndedTypes() { | 98 ModelTypeSet FakeSyncManager::InitialSyncEndedTypes() { |
99 return initial_sync_ended_types_; | 99 return initial_sync_ended_types_; |
100 } | 100 } |
101 | 101 |
102 ModelTypeSet FakeSyncManager::GetTypesWithEmptyProgressMarkerToken( | 102 ModelTypeSet FakeSyncManager::GetTypesWithEmptyProgressMarkerToken( |
103 ModelTypeSet types) { | 103 ModelTypeSet types) { |
104 ModelTypeSet empty_types = types; | 104 ModelTypeSet empty_types = types; |
105 empty_types.RemoveAll(progress_marker_types_); | 105 empty_types.RemoveAll(progress_marker_types_); |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 } | 258 } |
259 | 259 |
260 void FakeSyncManager::ClearServerData(const ClearServerDataCallback& callback) { | 260 void FakeSyncManager::ClearServerData(const ClearServerDataCallback& callback) { |
261 callback.Run(); | 261 callback.Run(); |
262 } | 262 } |
263 | 263 |
264 void FakeSyncManager::OnCookieJarChanged(bool account_mismatch, | 264 void FakeSyncManager::OnCookieJarChanged(bool account_mismatch, |
265 bool empty_jar) {} | 265 bool empty_jar) {} |
266 | 266 |
267 } // namespace syncer | 267 } // namespace syncer |
OLD | NEW |