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" |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 base::RunLoop run_loop; | 65 base::RunLoop run_loop; |
66 if (!sync_task_runner_->PostTaskAndReply( | 66 if (!sync_task_runner_->PostTaskAndReply( |
67 FROM_HERE, | 67 FROM_HERE, |
68 base::Bind(&base::DoNothing), | 68 base::Bind(&base::DoNothing), |
69 run_loop.QuitClosure())) { | 69 run_loop.QuitClosure())) { |
70 NOTREACHED(); | 70 NOTREACHED(); |
71 } | 71 } |
72 run_loop.Run(); | 72 run_loop.Run(); |
73 } | 73 } |
74 | 74 |
75 void FakeSyncManager::Init( | 75 void FakeSyncManager::Init(InitArgs* args) { |
76 const base::FilePath& database_location, | |
77 const WeakHandle<JsEventHandler>& event_handler, | |
78 const GURL& service_url, | |
79 scoped_ptr<HttpPostProviderFactory> post_factory, | |
80 const std::vector<scoped_refptr<ModelSafeWorker> >& workers, | |
81 ExtensionsActivity* extensions_activity, | |
82 ChangeDelegate* change_delegate, | |
83 const SyncCredentials& credentials, | |
84 const std::string& invalidator_client_id, | |
85 const std::string& restored_key_for_bootstrapping, | |
86 const std::string& restored_keystore_key_for_bootstrapping, | |
87 InternalComponentsFactory* internal_components_factory, | |
88 Encryptor* encryptor, | |
89 scoped_ptr<UnrecoverableErrorHandler> unrecoverable_error_handler, | |
90 ReportUnrecoverableErrorFunction report_unrecoverable_error_function, | |
91 CancelationSignal* cancelation_signal) { | |
92 sync_task_runner_ = base::ThreadTaskRunnerHandle::Get(); | 76 sync_task_runner_ = base::ThreadTaskRunnerHandle::Get(); |
93 PurgePartiallySyncedTypes(); | 77 PurgePartiallySyncedTypes(); |
94 | 78 |
95 test_user_share_.SetUp(); | 79 test_user_share_.SetUp(); |
96 UserShare* share = test_user_share_.user_share(); | 80 UserShare* share = test_user_share_.user_share(); |
97 for (ModelTypeSet::Iterator it = initial_sync_ended_types_.First(); | 81 for (ModelTypeSet::Iterator it = initial_sync_ended_types_.First(); |
98 it.Good(); it.Inc()) { | 82 it.Good(); it.Inc()) { |
99 TestUserShare::CreateRoot(it.Get(), share); | 83 TestUserShare::CreateRoot(it.Get(), share); |
100 } | 84 } |
101 | 85 |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 | 251 |
268 ModelTypeSet FakeSyncManager::GetLastRefreshRequestTypes() { | 252 ModelTypeSet FakeSyncManager::GetLastRefreshRequestTypes() { |
269 return last_refresh_request_types_; | 253 return last_refresh_request_types_; |
270 } | 254 } |
271 | 255 |
272 void FakeSyncManager::SetInvalidatorEnabled(bool invalidator_enabled) { | 256 void FakeSyncManager::SetInvalidatorEnabled(bool invalidator_enabled) { |
273 // Do nothing. | 257 // Do nothing. |
274 } | 258 } |
275 | 259 |
276 } // namespace syncer | 260 } // namespace syncer |
OLD | NEW |