diff options
author | albertb@chromium.org <albertb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-18 20:49:57 +0000 |
---|---|---|
committer | albertb@chromium.org <albertb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-18 20:49:57 +0000 |
commit | d411a67de56213f4b5053bca3772ef20a0b32b0e (patch) | |
tree | 4591ea22a470df704ef3ad7944c6e89ec69fe767 /chrome | |
parent | c9b6eb6902766de9edf75921151d225572079a53 (diff) | |
download | chromium_src-d411a67de56213f4b5053bca3772ef20a0b32b0e.zip chromium_src-d411a67de56213f4b5053bca3772ef20a0b32b0e.tar.gz chromium_src-d411a67de56213f4b5053bca3772ef20a0b32b0e.tar.bz2 |
Integration tests for two-client Nigori conflicts.
R=rsimha
BUG=none
TEST=this is a test
Review URL: http://codereview.chromium.org/8294023
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@106125 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/sync/test/integration/two_client_passwords_sync_test.cc | 40 |
1 files changed, 40 insertions, 0 deletions
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 74341495..e5164c7 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 @@ -26,6 +26,7 @@ using passwords_helper::UpdateLogin; using webkit_glue::PasswordForm; static const char* kValidPassphrase = "passphrase!"; +static const char* kAnotherValidPassphrase = "another passphrase!"; class TwoClientPasswordsSyncTest : public SyncTest { public: @@ -321,3 +322,42 @@ IN_PROC_BROWSER_TEST_F(TwoClientPasswordsSyncTest, ASSERT_TRUE(GetClient(1)->AwaitPassphraseAccepted()); ASSERT_TRUE(GetClient(1)->AwaitFullSyncCompletion("Set passphrase again.")); } + +// TODO(sync): Enable after MockKeychain is fixed. http://crbug.com/89808. +#if defined(OS_MACOSX) +IN_PROC_BROWSER_TEST_F(TwoClientPasswordsSyncTest, + DISABLED_SetDifferentPassphraseAndThenSetupSync) { +#else +IN_PROC_BROWSER_TEST_F(TwoClientPasswordsSyncTest, + SetDifferentPassphraseAndThenSetupSync) { +#endif + ASSERT_TRUE(SetupClients()) << "SetupClients() failed."; + + ASSERT_TRUE(GetClient(0)->SetupSync()); + SetPassphrase(0, kValidPassphrase); + ASSERT_TRUE(GetClient(0)->AwaitPassphraseAccepted()); + ASSERT_TRUE(GetClient(0)->AwaitFullSyncCompletion("Initial sync.")); + + // Setup 1 with a different passphrase, so that it fails to sync. + 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); + AddLogin(GetVerifierPasswordStore(), form0); + AddLogin(GetPasswordStore(0), form0); + + ASSERT_TRUE(GetClient(0)->AwaitFullSyncCompletion("Added a password.")); + + // Password hasn't been synced to 1 yet. + ASSERT_FALSE(AllProfilesContainSamePasswordFormsAsVerifier()); + + // Update 1 with the correct passphrase, the password should now sync over. + SetPassphrase(1, kValidPassphrase); + ASSERT_TRUE(GetClient(1)->AwaitPassphraseAccepted()); + + ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); + ASSERT_TRUE(AllProfilesContainSamePasswordFormsAsVerifier()); +} |