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

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

Issue 2767893002: Remove ScopedVector from chrome/browser/. (Closed)
Patch Set: Address comments from zea@ 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..18c4a0cca0cc634e7b14044f46bbf47c32d2539e 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;
+ DCHECK(!clients_[index]);
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.
+ DCHECK(!invalidation_forwarders_[index]);
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());
+ DCHECK(!sync_refreshers_[i]);
+ 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() {
« no previous file with comments | « chrome/browser/sync/test/integration/sync_test.h ('k') | chrome/browser/sync_file_system/drive_backend/metadata_database.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698