Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(11)

Unified Diff: components/sync/engine/fake_sync_manager.cc

Issue 2644373003: Revert of [Sync] Make directory types registration explicit in ModelTypeRegistry (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/sync/engine/fake_sync_manager.h ('k') | components/sync/engine/model_type_configurer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/sync/engine/fake_sync_manager.cc
diff --git a/components/sync/engine/fake_sync_manager.cc b/components/sync/engine/fake_sync_manager.cc
index e9f9ce8b1f5556b8a771eb243c0a0d3099a77054..b97e933697889d95df158e4eca59f8539feb91b0 100644
--- a/components/sync/engine/fake_sync_manager.cc
+++ b/components/sync/engine/fake_sync_manager.cc
@@ -17,8 +17,10 @@
#include "base/threading/thread_task_runner_handle.h"
#include "components/sync/base/weak_handle.h"
#include "components/sync/engine/engine_components_factory.h"
+#include "components/sync/engine/fake_model_type_connector.h"
#include "components/sync/engine/net/http_post_provider_factory.h"
#include "components/sync/syncable/directory.h"
+#include "components/sync/test/fake_sync_encryption_handler.h"
class GURL;
@@ -31,7 +33,9 @@
progress_marker_types_(progress_marker_types),
configure_fail_types_(configure_fail_types),
last_configure_reason_(CONFIGURE_REASON_UNKNOWN),
- num_invalidations_received_(0) {}
+ num_invalidations_received_(0) {
+ fake_encryption_handler_ = base::MakeUnique<FakeSyncEncryptionHandler>();
+}
FakeSyncManager::~FakeSyncManager() {}
@@ -51,6 +55,12 @@
ModelTypeSet downloaded_types = downloaded_types_;
downloaded_types_.Clear();
return downloaded_types;
+}
+
+ModelTypeSet FakeSyncManager::GetAndResetEnabledTypes() {
+ ModelTypeSet enabled_types = enabled_types_;
+ enabled_types_.Clear();
+ return enabled_types;
}
ConfigureReason FakeSyncManager::GetAndResetConfigureReason() {
@@ -134,20 +144,20 @@
NOTIMPLEMENTED();
}
-void FakeSyncManager::StartSyncingNormally(base::Time last_poll_time) {
- // Do nothing.
-}
-
-void FakeSyncManager::StartConfiguration() {
+void FakeSyncManager::StartSyncingNormally(
+ const ModelSafeRoutingInfo& routing_info,
+ base::Time last_poll_time) {
// Do nothing.
}
void FakeSyncManager::ConfigureSyncer(
ConfigureReason reason,
ModelTypeSet to_download,
+ const ModelSafeRoutingInfo& new_routing_info,
const base::Closure& ready_task,
const base::Closure& retry_task) {
last_configure_reason_ = reason;
+ enabled_types_ = GetRoutingInfoTypes(new_routing_info);
ModelTypeSet success_types = to_download;
success_types.RemoveAll(configure_fail_types_);
@@ -198,10 +208,6 @@
return test_user_share_.user_share();
}
-ModelTypeConnector* FakeSyncManager::GetModelTypeConnector() {
- return &fake_model_type_connector_;
-}
-
std::unique_ptr<ModelTypeConnector>
FakeSyncManager::GetModelTypeConnectorProxy() {
return base::MakeUnique<FakeModelTypeConnector>();
@@ -221,7 +227,7 @@
}
SyncEncryptionHandler* FakeSyncManager::GetEncryptionHandler() {
- return &fake_encryption_handler_;
+ return fake_encryption_handler_.get();
}
std::vector<std::unique_ptr<ProtocolEvent>>
« no previous file with comments | « components/sync/engine/fake_sync_manager.h ('k') | components/sync/engine/model_type_configurer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698