summaryrefslogtreecommitdiffstats
path: root/chrome/browser/sync/profile_sync_service_harness.h
diff options
context:
space:
mode:
authorrsimha@chromium.org <rsimha@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-02 19:47:43 +0000
committerrsimha@chromium.org <rsimha@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-02 19:47:43 +0000
commit43c48fb9f34da682482635dae6ebf1b3dcdae560 (patch)
tree7fbbcf193aaac9e248513fbf96a3264679e047e3 /chrome/browser/sync/profile_sync_service_harness.h
parent7c4e90901e7f3b641672f90a9f8080320dbfceec (diff)
downloadchromium_src-43c48fb9f34da682482635dae6ebf1b3dcdae560.zip
chromium_src-43c48fb9f34da682482635dae6ebf1b3dcdae560.tar.gz
chromium_src-43c48fb9f34da682482635dae6ebf1b3dcdae560.tar.bz2
Refactor sync passphrase setup flow and fix passphrase tests
The passphrase sync integration tests are in a state of disrepair due to several recent changes to the sync implementation. In particular, passphrase sync uses two similar methods called OnPassphraseRequired and OnPassphraseFailed to differentiate between cases where a passphrase is required for a first attempt at decryption and cases where decryption with a cached passphrase failed and the user needs to be prompted. This patch refactors the "for_decryption" boolean flag into an enum called PassphraseRequiredReason, thereby eliminating the need for OnPassphraseFailed. It also fixes the tests and updates the test framework to account for scenarios in which a client is waiting for a passphrase that has been set by one of its partners, and enables it to exit early when forward progress is impossible without a call to SetPassphrase. BUG=78840, 80180, 81018 TEST=sync_integration_tests Review URL: http://codereview.chromium.org/6902101 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@83764 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/sync/profile_sync_service_harness.h')
-rw-r--r--chrome/browser/sync/profile_sync_service_harness.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/chrome/browser/sync/profile_sync_service_harness.h b/chrome/browser/sync/profile_sync_service_harness.h
index 16dc81f..af1d83c 100644
--- a/chrome/browser/sync/profile_sync_service_harness.h
+++ b/chrome/browser/sync/profile_sync_service_harness.h
@@ -172,6 +172,9 @@ class ProfileSyncServiceHarness : public ProfileSyncServiceObserver {
// full sync cycle is not expected to occur.
WAITING_FOR_SYNC_CONFIGURATION,
+ // The sync client needs a passphrase in order to decrypt data.
+ SET_PASSPHRASE_FAILED,
+
// The sync client cannot reach the server.
SERVER_UNREACHABLE,
@@ -212,16 +215,21 @@ class ProfileSyncServiceHarness : public ProfileSyncServiceObserver {
// for a particular datatype.
std::string GetUpdatedTimestamp(syncable::ModelType model_type);
- // Gets the status from |service_| in pretty printable form.
+ // Gets detailed status from |service_| in pretty-printable form.
std::string GetServiceStatus();
// When in WAITING_FOR_ENCRYPTION state, we check to see if this type is now
// encrypted to determine if we're done.
syncable::ModelType waiting_for_encryption_type_;
+ // The WaitState in which the sync client currently is. Helps determine what
+ // action to take when RunStateChangeMachine() is called.
WaitState wait_state_;
+ // Sync profile associated with this sync client.
Profile* profile_;
+
+ // ProfileSyncService object associated with |profile_|.
ProfileSyncService* service_;
// The harness of the client whose update progress marker we're expecting