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

Unified Diff: chrome/browser/sync/test/integration/sync_test.cc

Issue 2767893002: Remove ScopedVector from chrome/browser/. (Closed)
Patch Set: Created 3 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: 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 8c53b5475ab84b56cb2dbcdc950118f3c060c2ad..6dab14a335e15523f601ab322a47bb97b964cbea 100644
--- a/chrome/browser/sync/test/integration/sync_test.cc
+++ b/chrome/browser/sync/test/integration/sync_test.cc
@@ -468,7 +468,14 @@ ProfileSyncServiceHarness* SyncTest::GetClient(int index) {
LOG(FATAL) << "SetupClients() has not yet been called.";
if (index < 0 || index >= static_cast<int>(clients_.size()))
LOG(FATAL) << "GetClient(): Index is out of bounds.";
- return clients_[index];
+ return clients_[index].get();
+}
+
+std::vector<ProfileSyncServiceHarness*> SyncTest::GetSyncClients() {
+ std::vector<ProfileSyncServiceHarness*> clients(clients_.size());
+ for (size_t i = 0; i < clients_.size(); ++i)
+ clients[i] = clients_[i].get();
+ return clients;
}
ProfileSyncService* SyncTest::GetSyncService(int index) {
@@ -585,6 +592,7 @@ void SyncTest::InitializeProfile(int index, Profile* profile) {
? ProfileSyncServiceHarness::SigninType::UI_SIGNIN
: ProfileSyncServiceHarness::SigninType::FAKE_SIGNIN;
+ clients_[index].release();
Avi (use Gerrit) 2017/03/23 02:44:48 Is this right? I know that this preserves the code
leonhsl(Using Gerrit) 2017/03/23 15:03:17 Yeah I also felt a little weak here.. After checki
skym 2017/03/23 19:28:05 I agree that the intention is that each index is w
Avi (use Gerrit) 2017/03/23 19:36:33 Yes. If you assigned through operator[] of ScopedV
Nicolas Zea 2017/03/23 20:06:47 Agreed with Sky. I'm fairly sure this wasn't inten
clients_[index] =
ProfileSyncServiceHarness::Create(GetProfile(index),
username_,
@@ -629,9 +637,10 @@ void SyncTest::InitializeInvalidations(int index) {
GetInvalidationService());
p2p_invalidation_service->UpdateCredentials(username_, password_);
// Start listening for and emitting notifications of commits.
+ invalidation_forwarders_[index].release();
Avi (use Gerrit) 2017/03/23 02:44:48 ditto
invalidation_forwarders_[index] =
- new P2PInvalidationForwarder(clients_[index]->service(),
- p2p_invalidation_service);
+ base::MakeUnique<P2PInvalidationForwarder>(clients_[index]->service(),
+ p2p_invalidation_service);
}
}
@@ -687,8 +696,9 @@ bool SyncTest::SetupSync() {
// client set up.
if (UsingExternalServers()) {
for (int i = 0; i < num_clients_; ++i) {
- sync_refreshers_[i] =
- new P2PSyncRefresher(GetProfile(i), clients_[i]->service());
+ sync_refreshers_[i].release();
Avi (use Gerrit) 2017/03/23 02:44:48 ditto
+ sync_refreshers_[i] = base::MakeUnique<P2PSyncRefresher>(
+ GetProfile(i), clients_[i]->service());
}
// OneClickSigninSyncStarter observer is created with a real user sign in.
@@ -1084,7 +1094,7 @@ bool SyncTest::AwaitEncryptionComplete(int index) {
}
bool SyncTest::AwaitQuiescence() {
- return ProfileSyncServiceHarness::AwaitQuiescence(clients());
+ return ProfileSyncServiceHarness::AwaitQuiescence(GetSyncClients());
}
bool SyncTest::UsingExternalServers() {

Powered by Google App Engine
This is Rietveld 408576698