Chromium Code Reviews| Index: sync/internal_api/test/fake_sync_manager.cc |
| diff --git a/sync/internal_api/test/fake_sync_manager.cc b/sync/internal_api/test/fake_sync_manager.cc |
| index 894a953bb8f8e34c0ffd66af7be3ced70c6f9f4c..5e6f6de1fb606e93b1302bb085ed07449d150380 100644 |
| --- a/sync/internal_api/test/fake_sync_manager.cc |
| +++ b/sync/internal_api/test/fake_sync_manager.cc |
| @@ -9,6 +9,7 @@ |
| #include "base/bind.h" |
| #include "base/location.h" |
| #include "base/logging.h" |
| +#include "base/run_loop.h" |
| #include "base/sequenced_task_runner.h" |
| #include "base/single_thread_task_runner.h" |
| #include "base/thread_task_runner_handle.h" |
| @@ -21,22 +22,15 @@ |
| namespace syncer { |
| -FakeSyncManager::FakeSyncManager() {} |
| +FakeSyncManager::FakeSyncManager(ModelTypeSet initial_sync_ended_types, |
| + ModelTypeSet progress_marker_types, |
| + ModelTypeSet configure_fail_types) : |
| + initial_sync_ended_types_(initial_sync_ended_types), |
| + progress_marker_types_(progress_marker_types), |
| + configure_fail_types_(configure_fail_types) {} |
| FakeSyncManager::~FakeSyncManager() {} |
| -void FakeSyncManager::set_initial_sync_ended_types(ModelTypeSet types) { |
| - initial_sync_ended_types_ = types; |
| -} |
| - |
| -void FakeSyncManager::set_progress_marker_types(ModelTypeSet types) { |
| - progress_marker_types_ = types; |
| -} |
| - |
| -void FakeSyncManager::set_configure_fail_types(ModelTypeSet types) { |
| - configure_fail_types_ = types; |
| -} |
| - |
| ModelTypeSet FakeSyncManager::GetAndResetCleanedTypes() { |
| ModelTypeSet cleaned_types = cleaned_types_; |
| cleaned_types_.Clear(); |
| @@ -85,6 +79,23 @@ void FakeSyncManager::DisableNotifications( |
| } |
| } |
| +namespace { |
| + |
| +void DoNothing() {} |
| + |
| +} // namespace |
| + |
| +void FakeSyncManager::WaitForSyncThread() { |
|
msw
2012/08/03 23:30:46
What is this doing? Add a comment as to why this i
akalin
2012/08/07 07:25:19
Done.
|
| + base::RunLoop run_loop; |
| + if (!sync_task_runner_->PostTaskAndReply( |
| + FROM_HERE, |
| + base::Bind(&DoNothing), |
| + run_loop.QuitClosure())) { |
| + NOTREACHED(); |
| + } |
| + run_loop.Run(); |
| +} |
| + |
| bool FakeSyncManager::Init( |
| const FilePath& database_location, |
| const WeakHandle<JsEventHandler>& event_handler, |
| @@ -150,9 +161,14 @@ void FakeSyncManager::UpdateEnabledTypes(const ModelTypeSet& types) { |
| enabled_types_ = types; |
| } |
| +void FakeSyncManager::SetInvalidationHandler( |
| + const std::string& handler_name, SyncNotifierObserver* handler) { |
|
msw
2012/08/03 23:30:46
one param per line
akalin
2012/08/07 07:25:19
Done.
|
| + notifier_helper_.SetHandler(handler_name, handler); |
| +} |
| + |
| void FakeSyncManager::UpdateRegisteredInvalidationIds( |
| - SyncNotifierObserver* handler, const ObjectIdSet& ids) { |
| - notifier_helper_.UpdateRegisteredIds(handler, ids); |
| + const std::string& handler_name, const ObjectIdSet& ids) { |
|
msw
2012/08/03 23:30:46
one param per line
akalin
2012/08/07 07:25:19
Done.
|
| + notifier_helper_.UpdateRegisteredIds(handler_name, ids); |
| } |
| void FakeSyncManager::StartSyncingNormally( |