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

Unified Diff: chrome/browser/sync/test/integration/sync_test.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: chrome/browser/sync/test/integration/sync_test.cc
diff --git a/chrome/browser/sync/test/integration/sync_test.cc b/chrome/browser/sync/test/integration/sync_test.cc
index a6d03b51048817c852e6b4b017e07a27b01d328e..d12af4c9dd20c28bf48cce2b34acbe8a285c0f9a 100644
--- a/chrome/browser/sync/test/integration/sync_test.cc
+++ b/chrome/browser/sync/test/integration/sync_test.cc
@@ -354,8 +354,9 @@ void SyncTest::CreateProfile(int index) {
// Without need of real GAIA authentication, we create new test profiles.
// For test profiles, a custom delegate needs to be used to do the
// initialization work before the profile is registered.
- profile_delegates_[index].reset(new SyncProfileDelegate(base::Bind(
- &SyncTest::InitializeProfile, base::Unretained(this), index)));
+ profile_delegates_[index] =
+ base::MakeUnique<SyncProfileDelegate>(base::Bind(
+ &SyncTest::InitializeProfile, base::Unretained(this), index));
MakeTestProfile(profile_path, index);
}
@@ -507,8 +508,8 @@ bool SyncTest::SetupClients() {
if (use_verifier_) {
base::FilePath user_data_dir;
PathService::Get(chrome::DIR_USER_DATA, &user_data_dir);
- profile_delegates_[num_clients_].reset(
- new SyncProfileDelegate(base::Callback<void(Profile*)>()));
+ profile_delegates_[num_clients_] =
+ base::MakeUnique<SyncProfileDelegate>(base::Callback<void(Profile*)>());
verifier_ = MakeTestProfile(
user_data_dir.Append(FILE_PATH_LITERAL("Verifier")), num_clients_);
WaitForDataModels(verifier());
@@ -701,8 +702,8 @@ void SyncTest::SetUpInProcessBrowserTestFixture() {
resolver->AllowDirectLookup("*.thawte.com");
resolver->AllowDirectLookup("*.geotrust.com");
resolver->AllowDirectLookup("*.gstatic.com");
- mock_host_resolver_override_.reset(
- new net::ScopedDefaultHostResolverProc(resolver));
+ mock_host_resolver_override_ =
+ base::MakeUnique<net::ScopedDefaultHostResolverProc>(resolver);
}
void SyncTest::TearDownInProcessBrowserTestFixture() {
@@ -738,8 +739,8 @@ void SyncTest::ReadPasswordFile() {
}
void SyncTest::SetupMockGaiaResponses() {
- factory_.reset(new net::URLFetcherImplFactory());
- fake_factory_.reset(new net::FakeURLFetcherFactory(factory_.get()));
+ factory_ = base::MakeUnique<net::URLFetcherImplFactory>();
+ fake_factory_ = base::MakeUnique<net::FakeURLFetcherFactory>(factory_.get());
fake_factory_->SetFakeResponse(
GaiaUrls::GetInstance()->get_user_info_url(),
"email=user@gmail.com\ndisplayEmail=user@gmail.com",
@@ -868,7 +869,7 @@ void SyncTest::SetUpTestServerIfRequired() {
if (!SetUpLocalTestServer())
LOG(FATAL) << "Failed to set up local test server";
} else if (server_type_ == IN_PROCESS_FAKE_SERVER) {
- fake_server_.reset(new fake_server::FakeServer());
+ fake_server_ = base::MakeUnique<fake_server::FakeServer>();
SetupMockGaiaResponses();
} else {
LOG(FATAL) << "Don't know which server environment to run test in.";
@@ -898,7 +899,7 @@ bool SyncTest::SetUpLocalPythonTestServer() {
net::HostPortPair xmpp_host_port_pair(sync_server_.host_port_pair());
xmpp_host_port_pair.set_port(xmpp_port);
- xmpp_port_.reset(new net::ScopedPortException(xmpp_port));
+ xmpp_port_ = base::MakeUnique<net::ScopedPortException>(xmpp_port);
if (!cl->HasSwitch(invalidation::switches::kSyncNotificationHostPort)) {
cl->AppendSwitchASCII(invalidation::switches::kSyncNotificationHostPort,

Powered by Google App Engine
This is Rietveld 408576698