summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrlarocque@chromium.org <rlarocque@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-20 00:01:29 +0000
committerrlarocque@chromium.org <rlarocque@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-20 00:01:29 +0000
commit1462329583a8219fb9adee6dc95e29c927e9e165 (patch)
treea14bec890ab9c7a1c927122a2617f3adb2274b7f
parent51e43878421f96d21ac21740b3bca88dc34a9d53 (diff)
downloadchromium_src-1462329583a8219fb9adee6dc95e29c927e9e165.zip
chromium_src-1462329583a8219fb9adee6dc95e29c927e9e165.tar.gz
chromium_src-1462329583a8219fb9adee6dc95e29c927e9e165.tar.bz2
Fix sync passphrase integration test reliability
This is an attempt to fix the flakiness of sync integration tests using explicit passphrases that are affected by the race described in crbug.com/110529. As far as I know, this issue is not very common, though I suspect it is related to the much more common crbug.com/95269. The reason I am attempting to fix this is that I have some patches that change the behaviour of the sync cycle and tend to make this issue more common. The actual change is simple: allow clients to be considered "fully synced" even when they require a passphrase to decrypt their contents. Tests that require a certain cryptographer state can use the AwaitPassphraseRequired() and AwaitPassphraseAccepted() functions to make assertions about or wait on password state. It seems most tests that need to make these kinds of assertions are already using those functions, so this change does not require any changes to existing integration tests. BUG=110529 TEST=sync_integration_tests Review URL: https://chromiumcodereview.appspot.com/9249047 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@118387 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/sync/profile_sync_service_harness.cc11
-rw-r--r--chrome/browser/sync/test/integration/two_client_passwords_sync_test.cc3
2 files changed, 2 insertions, 12 deletions
diff --git a/chrome/browser/sync/profile_sync_service_harness.cc b/chrome/browser/sync/profile_sync_service_harness.cc
index e675efb..b2b251e 100644
--- a/chrome/browser/sync/profile_sync_service_harness.cc
+++ b/chrome/browser/sync/profile_sync_service_harness.cc
@@ -272,13 +272,6 @@ bool ProfileSyncServiceHarness::RunStateChangeMachine() {
SignalStateCompleteWithNextState(FULLY_SYNCED);
break;
}
- if (service()->passphrase_required_reason() ==
- sync_api::REASON_SET_PASSPHRASE_FAILED) {
- // A passphrase is required for decryption and we don't have it. Do not
- // wait any more.
- SignalStateCompleteWithNextState(SET_PASSPHRASE_FAILED);
- break;
- }
if (!GetStatus().server_reachable) {
// The client cannot reach the sync server because the network is
// disabled. There is no need to wait anymore.
@@ -771,9 +764,7 @@ bool ProfileSyncServiceHarness::IsDataSyncedImpl(
GetStatus().notifications_enabled &&
!service()->HasUnsyncedItems() &&
!snap->has_more_to_sync &&
- !HasPendingBackendMigration() &&
- service()->passphrase_required_reason() !=
- sync_api::REASON_SET_PASSPHRASE_FAILED;
+ !HasPendingBackendMigration();
}
bool ProfileSyncServiceHarness::IsDataSynced() {
diff --git a/chrome/browser/sync/test/integration/two_client_passwords_sync_test.cc b/chrome/browser/sync/test/integration/two_client_passwords_sync_test.cc
index 7efd308..9b62e2f 100644
--- a/chrome/browser/sync/test/integration/two_client_passwords_sync_test.cc
+++ b/chrome/browser/sync/test/integration/two_client_passwords_sync_test.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -272,7 +272,6 @@ IN_PROC_BROWSER_TEST_F(TwoClientPasswordsSyncTest,
ASSERT_FALSE(GetClient(1)->SetupSync());
SetPassphrase(1, kAnotherValidPassphrase);
ASSERT_TRUE(GetClient(1)->AwaitPassphraseRequired());
- ASSERT_FALSE(GetClient(1)->AwaitFullSyncCompletion("Initial sync."));
// Add a password on 0 while clients have different passphrases.
PasswordForm form0 = CreateTestPasswordForm(0);