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

Unified Diff: sync/internal_api/test/fake_model_type_service.cc

Issue 1763953002: [USS] Change the place where SharedModelTypeProcessor got created (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sky's review Created 4 years, 9 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
Index: sync/internal_api/test/fake_model_type_service.cc
diff --git a/sync/internal_api/test/fake_model_type_service.cc b/sync/internal_api/test/fake_model_type_service.cc
index 8f1e14c9f22b4279c583d078aec1bdbf43aa6c30..0a64165a64059ab66b84c2e7ab23bc062ebb9fdb 100644
--- a/sync/internal_api/test/fake_model_type_service.cc
+++ b/sync/internal_api/test/fake_model_type_service.cc
@@ -4,9 +4,16 @@
#include "sync/internal_api/public/test/fake_model_type_service.h"
+#include "base/bind.h"
+#include "sync/internal_api/public/shared_model_type_processor.h"
+
namespace syncer_v2 {
-FakeModelTypeService::FakeModelTypeService() {}
+FakeModelTypeService::FakeModelTypeService()
+ : ModelTypeService(
+ base::Bind(&FakeModelTypeService::CreateProcessorForTestWrapper,
+ base::Unretained(this))),
+ processor_(nullptr) {}
FakeModelTypeService::~FakeModelTypeService() {}
@@ -38,4 +45,27 @@ std::string FakeModelTypeService::GetClientTag(const EntityData& entity_data) {
void FakeModelTypeService::OnChangeProcessorSet() {}
+syncer::ModelType FakeModelTypeService::type() const {
+ return syncer::DEVICE_INFO;
+}
+
+ModelTypeChangeProcessor* FakeModelTypeService::CreateProcessorForTest(
+ syncer::ModelType type,
+ ModelTypeService* service) {
+ return processor_;
+}
+
+scoped_ptr<ModelTypeChangeProcessor>
+FakeModelTypeService::CreateProcessorForTestWrapper(syncer::ModelType type,
+ ModelTypeService* service) {
+ return make_scoped_ptr(CreateProcessorForTest(type, service));
+}
+
+base::WeakPtr<SharedModelTypeProcessor> FakeModelTypeService::SetUpProcessor(
+ ModelTypeChangeProcessor* processor) {
+ processor_ = processor;
+ return static_cast<SharedModelTypeProcessor*>(GetOrCreateChangeProcessor())
+ ->AsWeakPtrForUI();
+}
+
} // namespace syncer_v2
« sync/api/model_type_service.cc ('K') | « sync/internal_api/shared_model_type_processor_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698