summaryrefslogtreecommitdiffstats
path: root/chrome/browser/sync/test/integration
diff options
context:
space:
mode:
authormaxbogue <maxbogue@chromium.org>2016-03-11 10:47:10 -0800
committerCommit bot <commit-bot@chromium.org>2016-03-11 18:48:27 +0000
commit76b6100f27b728e8235746b14e4a8c784eae4549 (patch)
treeb27b99c4f85015addf5fc2e792a670f01c3f4a87 /chrome/browser/sync/test/integration
parentbc7a86115749939e239f9ec5bb775f0171620a8e (diff)
downloadchromium_src-76b6100f27b728e8235746b14e4a8c784eae4549.zip
chromium_src-76b6100f27b728e8235746b14e4a8c784eae4549.tar.gz
chromium_src-76b6100f27b728e8235746b14e4a8c784eae4549.tar.bz2
[Sync] Simplify sync startup behavior.
Now IsFirstSetupComplete, IsSetupInProgress, and AUTO_START do not directly factor into the sync startup logic. Instead, AUTO_START simply sets IsFirstSetupComplete to true on signin, and sync datatypes can only be configured if IsFirstSetupComplete && !IsSetupInProgress (aka the new CanConfigureDataTypes helper function). This change is motivated by wanting to have better understanding and control over when and how sync starts up in order to fix the attached bug. BUG=462796 Review URL: https://codereview.chromium.org/1575153004 Cr-Commit-Position: refs/heads/master@{#380685}
Diffstat (limited to 'chrome/browser/sync/test/integration')
-rw-r--r--chrome/browser/sync/test/integration/sync_test.cc13
1 files changed, 10 insertions, 3 deletions
diff --git a/chrome/browser/sync/test/integration/sync_test.cc b/chrome/browser/sync/test/integration/sync_test.cc
index 2aaedad..259efd6 100644
--- a/chrome/browser/sync/test/integration/sync_test.cc
+++ b/chrome/browser/sync/test/integration/sync_test.cc
@@ -590,14 +590,18 @@ void SyncTest::InitializeInvalidations(int index) {
bool SyncTest::SetupSync() {
// 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
@@ -608,7 +612,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