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

Unified Diff: components/sync/engine_impl/model_type_registry_unittest.cc

Issue 2442583003: [Sync] Start implementation of migration for USS. (Closed)
Patch Set: Fix other tests. Created 4 years, 2 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/engine_impl/model_type_registry_unittest.cc
diff --git a/components/sync/engine_impl/model_type_registry_unittest.cc b/components/sync/engine_impl/model_type_registry_unittest.cc
index 948b1f5a3045db26a3f0efd783e9217d4bf206c3..f69fe975e5427c2653502996f2ae060032a35276 100644
--- a/components/sync/engine_impl/model_type_registry_unittest.cc
+++ b/components/sync/engine_impl/model_type_registry_unittest.cc
@@ -15,9 +15,9 @@
#include "components/sync/syncable/directory.h"
#include "components/sync/syncable/model_neutral_mutable_entry.h"
#include "components/sync/syncable/syncable_model_neutral_write_transaction.h"
+#include "components/sync/syncable/test_user_share.h"
#include "components/sync/test/engine/fake_model_worker.h"
#include "components/sync/test/engine/mock_nudge_handler.h"
-#include "components/sync/test/engine/test_directory_setter_upper.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace syncer {
@@ -40,8 +40,7 @@ class ModelTypeRegistryTest : public ::testing::Test {
static std::unique_ptr<ActivationContext> MakeActivationContext(
const sync_pb::ModelTypeState& model_type_state,
std::unique_ptr<ModelTypeProcessor> type_processor) {
- std::unique_ptr<ActivationContext> context =
- base::WrapUnique(new ActivationContext);
+ auto context = base::MakeUnique<ActivationContext>();
context->model_type_state = model_type_state;
context->type_processor = std::move(type_processor);
return context;
@@ -63,7 +62,7 @@ class ModelTypeRegistryTest : public ::testing::Test {
base::MessageLoop message_loop_;
- TestDirectorySetterUpper dir_maker_;
+ TestUserShare test_user_share_;
std::vector<scoped_refptr<ModelSafeWorker>> workers_;
std::unique_ptr<ModelTypeRegistry> registry_;
MockNudgeHandler mock_nudge_handler_;
@@ -72,7 +71,7 @@ class ModelTypeRegistryTest : public ::testing::Test {
ModelTypeRegistryTest::ModelTypeRegistryTest() {}
void ModelTypeRegistryTest::SetUp() {
- dir_maker_.SetUp();
+ test_user_share_.SetUp();
scoped_refptr<ModelSafeWorker> passive_worker(
new FakeModelWorker(GROUP_PASSIVE));
scoped_refptr<ModelSafeWorker> ui_worker(new FakeModelWorker(GROUP_UI));
@@ -81,14 +80,14 @@ void ModelTypeRegistryTest::SetUp() {
workers_.push_back(ui_worker);
workers_.push_back(db_worker);
- registry_ = base::MakeUnique<ModelTypeRegistry>(workers_, directory(),
- &mock_nudge_handler_);
+ registry_ = base::MakeUnique<ModelTypeRegistry>(
+ workers_, test_user_share_.user_share(), &mock_nudge_handler_);
}
void ModelTypeRegistryTest::TearDown() {
registry_.reset();
workers_.clear();
- dir_maker_.TearDown();
+ test_user_share_.TearDown();
}
ModelTypeRegistry* ModelTypeRegistryTest::registry() {
@@ -96,7 +95,7 @@ ModelTypeRegistry* ModelTypeRegistryTest::registry() {
}
syncable::Directory* ModelTypeRegistryTest::directory() {
- return dir_maker_.directory();
+ return test_user_share_.user_share()->directory.get();
}
// Create some directory update handlers and commit contributors.

Powered by Google App Engine
This is Rietveld 408576698