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

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: nit 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
« no previous file with comments | « sync/internal_api/shared_model_type_processor_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..109e2348e7c102ddcbe3b75301d3b49dea526aa2 100644
--- a/sync/internal_api/test/fake_model_type_service.cc
+++ b/sync/internal_api/test/fake_model_type_service.cc
@@ -4,9 +4,17 @@
#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)),
+ syncer::PREFERENCES),
+ processor_(nullptr) {}
FakeModelTypeService::~FakeModelTypeService() {}
@@ -38,4 +46,23 @@ std::string FakeModelTypeService::GetClientTag(const EntityData& entity_data) {
void FakeModelTypeService::OnChangeProcessorSet() {}
+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
« no previous file with comments | « 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