Chromium Code Reviews| 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..63be690608a99880b66306e00b221c69ad165f45 100644 |
| --- a/sync/internal_api/test/fake_model_type_service.cc |
| +++ b/sync/internal_api/test/fake_model_type_service.cc |
| @@ -4,9 +4,14 @@ |
| #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" |
|
maxbogue
2016/03/22 21:40:12
You should not be including this real class in a f
Gang Wu
2016/03/24 15:56:27
Done.
|
| + |
| namespace syncer_v2 { |
| -FakeModelTypeService::FakeModelTypeService() {} |
| +FakeModelTypeService::FakeModelTypeService() |
| + : ModelTypeService( |
| + base::Bind(&FakeModelTypeService::CreateSharedModelTypeProcessor)) {} |
|
maxbogue
2016/03/22 21:40:12
This should bind a private function (CreateProcess
skym
2016/03/22 22:18:18
Could also set a default argument for the factory
skym
2016/03/22 22:32:24
Max pointed out we shouldn't do this, he found htt
Gang Wu
2016/03/24 15:56:27
Done.
|
| FakeModelTypeService::~FakeModelTypeService() {} |
| @@ -38,4 +43,21 @@ std::string FakeModelTypeService::GetClientTag(const EntityData& entity_data) { |
| void FakeModelTypeService::OnChangeProcessorSet() {} |
| +syncer::ModelType FakeModelTypeService::type() const { |
| + return syncer::DEVICE_INFO; |
| +} |
| + |
| +ModelTypeChangeProcessor* FakeModelTypeService::CreateProcessorForTest() { |
| + return create_change_processor(); |
|
maxbogue
2016/03/22 21:40:12
Just return nullptr by default here.
Gang Wu
2016/03/24 15:56:27
Done.
|
| +} |
| + |
| +// static |
| +scoped_ptr<ModelTypeChangeProcessor> |
| +FakeModelTypeService::CreateSharedModelTypeProcessor( |
| + syncer::ModelType type, |
| + ModelTypeService* service) { |
| + return make_scoped_ptr( |
| + new syncer_v2::SharedModelTypeProcessor(type, service)); |
| +} |
| + |
| } // namespace syncer_v2 |