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

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

Issue 1575153004: [Sync] Simplify sync startup behavior. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@setup
Patch Set: Better comment + tests. Created 4 years, 10 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 3722d61a106315a23891f87a9a91e50a3512abed..15239490e7e5eead320e0c83d7df3bf22d65252a 100644
--- a/chrome/browser/sync/test/integration/sync_test.cc
+++ b/chrome/browser/sync/test/integration/sync_test.cc
@@ -596,19 +596,25 @@ bool SyncTest::SetupSync() {
if (create_gaia_account_at_runtime_) {
CHECK(UsingExternalServers()) <<
"Cannot create Gaia accounts without external authentication servers";
- if (!CreateGaiaAccount(username_, password_))
+ if (!CreateGaiaAccount(username_, password_)) {
LOG(FATAL) << "Could not create Gaia account.";
+ return false;
+ }
}
// Create sync profiles and clients if they haven't already been created.
if (profiles_.empty()) {
- if (!SetupClients())
+ if (!SetupClients()) {
LOG(FATAL) << "SetupClients() failed.";
+ return false;
+ }
}
// Sync each of the profiles.
for (int i = 0; i < num_clients_; ++i) {
- if (!GetClient(i)->SetupSync())
+ if (!GetClient(i)->SetupSync()) {
LOG(FATAL) << "SetupSync() failed.";
+ return false;
+ }
}
// Because clients may modify sync data as part of startup (for example local
@@ -619,7 +625,10 @@ bool SyncTest::SetupSync() {
// have to find their own way of waiting for an initial state if they really
// need such guarantees.
if (TestUsesSelfNotifications()) {
- AwaitQuiescence();
+ if (!AwaitQuiescence()) {
+ LOG(FATAL) << "AwaitQuiescence() failed.";
+ return false;
+ }
}
// SyncRefresher is used instead of invalidations to notify other profiles to

Powered by Google App Engine
This is Rietveld 408576698