Index: sync/internal_api/test/fake_sync_manager.cc |
=================================================================== |
--- sync/internal_api/test/fake_sync_manager.cc (revision 150991) |
+++ sync/internal_api/test/fake_sync_manager.cc (working copy) |
@@ -9,7 +9,6 @@ |
#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" |
@@ -22,15 +21,22 @@ |
namespace syncer { |
-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() {} |
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(); |
@@ -78,24 +84,6 @@ |
} |
} |
-namespace { |
- |
-void DoNothing() {} |
- |
-} // namespace |
- |
-void FakeSyncManager::WaitForSyncThread() { |
- // Post a task to |sync_task_runner_| and block until it runs. |
- base::RunLoop run_loop; |
- if (!sync_task_runner_->PostTaskAndReply( |
- FROM_HERE, |
- base::Bind(&DoNothing), |
- run_loop.QuitClosure())) { |
- NOTREACHED(); |
- } |
- run_loop.Run(); |
-} |
- |
void FakeSyncManager::Init( |
const FilePath& database_location, |
const WeakHandle<JsEventHandler>& event_handler, |
@@ -160,22 +148,12 @@ |
enabled_types_ = types; |
} |
-void FakeSyncManager::RegisterInvalidationHandler( |
- SyncNotifierObserver* handler) { |
- registrar_.RegisterHandler(handler); |
-} |
- |
void FakeSyncManager::UpdateRegisteredInvalidationIds( |
SyncNotifierObserver* handler, |
const ObjectIdSet& ids) { |
- registrar_.UpdateRegisteredIds(handler, ids); |
+ notifier_helper_.UpdateRegisteredIds(handler, ids); |
} |
-void FakeSyncManager::UnregisterInvalidationHandler( |
- SyncNotifierObserver* handler) { |
- registrar_.UnregisterHandler(handler); |
-} |
- |
void FakeSyncManager::StartSyncingNormally( |
const ModelSafeRoutingInfo& routing_info) { |
// Do nothing. |
@@ -286,18 +264,18 @@ |
const ObjectIdPayloadMap& id_payloads, |
IncomingNotificationSource source) { |
DCHECK(sync_task_runner_->RunsTasksOnCurrentThread()); |
- registrar_.DispatchInvalidationsToHandlers(id_payloads, source); |
+ notifier_helper_.DispatchInvalidationsToHandlers(id_payloads, source); |
} |
void FakeSyncManager::EnableNotificationsOnSyncThread() { |
DCHECK(sync_task_runner_->RunsTasksOnCurrentThread()); |
- registrar_.EmitOnNotificationsEnabled(); |
+ notifier_helper_.EmitOnNotificationsEnabled(); |
} |
void FakeSyncManager::DisableNotificationsOnSyncThread( |
NotificationsDisabledReason reason) { |
DCHECK(sync_task_runner_->RunsTasksOnCurrentThread()); |
- registrar_.EmitOnNotificationsDisabled(reason); |
+ notifier_helper_.EmitOnNotificationsDisabled(reason); |
} |
} // namespace syncer |