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

Unified Diff: components/sync_driver/device_info_service_unittest.cc

Issue 1763953002: [USS] Change the place where SharedModelTypeProcessor got created (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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: components/sync_driver/device_info_service_unittest.cc
diff --git a/components/sync_driver/device_info_service_unittest.cc b/components/sync_driver/device_info_service_unittest.cc
index 4cd69c6e6db3d95cbd604986e490496148032718..35cbe0ec375c78d0e075253be3c10228cfd8409f 100644
--- a/components/sync_driver/device_info_service_unittest.cc
+++ b/components/sync_driver/device_info_service_unittest.cc
@@ -19,6 +19,7 @@
#include "sync/api/entity_data.h"
#include "sync/api/metadata_batch.h"
#include "sync/api/model_type_store.h"
+#include "sync/internal_api/public/shared_model_type_processor.h"
#include "sync/internal_api/public/test/model_type_store_test_util.h"
#include "sync/protocol/data_type_state.pb.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -163,7 +164,12 @@ class DeviceInfoServiceTest : public testing::Test,
void OnDeviceInfoChange() override { change_count_++; }
- protected:
+ scoped_ptr<ModelTypeChangeProcessor> CreateModelTypeChangeProcessor(
+ ModelTypeService* service) {
+ processor_ = new FakeModelTypeChangeProcessor();
+ return make_scoped_ptr(processor_);
+ }
+
DeviceInfoServiceTest()
: change_count_(0),
store_(ModelTypeStoreTestUtil::CreateInMemoryStoreForTest()),
@@ -197,8 +203,9 @@ class DeviceInfoServiceTest : public testing::Test,
// pump in this scenario because metadata is going to need to be loading from
// the store and given to the processor, which is async.
void SetProcessorAndPump() {
- processor_ = new FakeModelTypeChangeProcessor();
- service()->set_change_processor(make_scoped_ptr(processor_));
+ service()->InitializeProcessor(
+ base::Bind(&DeviceInfoServiceTest::CreateModelTypeChangeProcessor,
+ base::Unretained(this)));
base::RunLoop().RunUntilIdle();
}

Powered by Google App Engine
This is Rietveld 408576698