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

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

Issue 2422253002: [Sync] Rewriting ".reset(new" pattern to use "= base::MakeUnique" instead. (Closed)
Patch Set: Fixing compile. 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/syncer_unittest.cc
diff --git a/components/sync/engine_impl/syncer_unittest.cc b/components/sync/engine_impl/syncer_unittest.cc
index 2acd8e0c4fd02c703c1a1dd4397433f27f1b9320..df52f80d440db9f10dba2d79091e84936473f8a2 100644
--- a/components/sync/engine_impl/syncer_unittest.cc
+++ b/components/sync/engine_impl/syncer_unittest.cc
@@ -21,6 +21,7 @@
#include "base/bind_helpers.h"
#include "base/compiler_specific.h"
#include "base/location.h"
+#include "base/memory/ptr_util.h"
#include "base/message_loop/message_loop.h"
#include "base/strings/string_number_conversions.h"
#include "base/test/histogram_tester.h"
@@ -266,9 +267,9 @@ class SyncerTest : public testing::Test,
void SetUp() override {
dir_maker_.SetUp();
- mock_server_.reset(
- new MockConnectionManager(directory(), &cancelation_signal_));
- debug_info_getter_.reset(new MockDebugInfoGetter);
+ mock_server_ = base::MakeUnique<MockConnectionManager>(
+ directory(), &cancelation_signal_);
+ debug_info_getter_ = base::MakeUnique<MockDebugInfoGetter>();
EnableDatatype(BOOKMARKS);
EnableDatatype(EXTENSIONS);
EnableDatatype(NIGORI);
@@ -282,24 +283,24 @@ class SyncerTest : public testing::Test,
ModelSafeRoutingInfo routing_info;
GetModelSafeRoutingInfo(&routing_info);
- model_type_registry_.reset(
- new ModelTypeRegistry(workers_, directory(), &mock_nudge_handler_));
+ model_type_registry_ = base::MakeUnique<ModelTypeRegistry>(
+ workers_, directory(), &mock_nudge_handler_);
model_type_registry_->RegisterDirectoryTypeDebugInfoObserver(
&debug_info_cache_);
- context_.reset(new SyncCycleContext(
+ context_ = base::MakeUnique<SyncCycleContext>(
mock_server_.get(), directory(), extensions_activity_.get(), listeners,
debug_info_getter_.get(), model_type_registry_.get(),
true, // enable keystore encryption
false, // force enable pre-commit GU avoidance experiment
- "fake_invalidator_client_id"));
+ "fake_invalidator_client_id");
context_->SetRoutingInfo(routing_info);
syncer_ = new Syncer(&cancelation_signal_);
- scheduler_.reset(new SyncSchedulerImpl(
+ scheduler_ = base::MakeUnique<SyncSchedulerImpl>(
"TestSyncScheduler", BackoffDelayProvider::FromDefaults(),
context_.get(),
// scheduler_ owned syncer_ now and will manage the memory of syncer_
- syncer_));
+ syncer_);
syncable::ReadTransaction trans(FROM_HERE, directory());
Directory::Metahandles children;
« no previous file with comments | « components/sync/engine_impl/sync_scheduler_impl_unittest.cc ('k') | components/sync/engine_impl/syncer_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698