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

Unified Diff: chrome/test/live_sync/two_client_live_passwords_sync_test.cc

Issue 5801003: Fix passphrase initialization flow in ProfileSyncServiceHarness (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Adding 2 new tests for Passphrases. Created 10 years 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
« no previous file with comments | « chrome/browser/sync/profile_sync_service_harness.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/live_sync/two_client_live_passwords_sync_test.cc
diff --git a/chrome/test/live_sync/two_client_live_passwords_sync_test.cc b/chrome/test/live_sync/two_client_live_passwords_sync_test.cc
index aa48771944c73de3fad29ad681c45b784e183839..f48363d69d81a4b2e3ab4de881e1d630dd300247 100644
--- a/chrome/test/live_sync/two_client_live_passwords_sync_test.cc
+++ b/chrome/test/live_sync/two_client_live_passwords_sync_test.cc
@@ -124,3 +124,49 @@ IN_PROC_BROWSER_TEST_F(TwoClientLivePasswordsSyncTest,
ASSERT_EQ(0, GetClient(1)->GetLastSessionSnapshot()->
num_conflicting_updates);
}
+
+// TODO(sync): Remove FAILS_ annotation after http://crbug.com/59867 is fixed.
+#if defined(OS_MACOSX)
+IN_PROC_BROWSER_TEST_F(TwoClientLivePasswordsSyncTest,
+ FAILS_SetPassphraseAndThenSetupSync) {
+#else
+IN_PROC_BROWSER_TEST_F(TwoClientLivePasswordsSyncTest,
+ SetPassphraseAndThenSetupSync) {
+#endif
+ ASSERT_TRUE(SetupClients()) << "SetupClients() failed.";
+ ASSERT_TRUE(GetClient(0)->SetupSync());
+ GetClient(0)->service()->SetPassphrase(kValidPassphrase, true);
+ GetClient(0)->AwaitPassphraseAccepted();
+ GetClient(0)->AwaitSyncCycleCompletion("Initial sync.");
+
+ ASSERT_TRUE(GetClient(1)->SetupSync());
+ ASSERT_TRUE(AwaitQuiescence());
+ ASSERT_TRUE(GetClient(1)->service()->observed_passphrase_required());
+ GetClient(1)->service()->SetPassphrase(kValidPassphrase, true);
+ GetClient(1)->AwaitPassphraseAccepted();
+ ASSERT_FALSE(GetClient(1)->service()->observed_passphrase_required());
+}
+
+// TODO(sync): Remove FAILS_ annotation after http://crbug.com/59867 is fixed.
+#if defined(OS_MACOSX)
+IN_PROC_BROWSER_TEST_F(TwoClientLivePasswordsSyncTest,
+ FAILS_SetPassphraseTwice) {
+#else
+IN_PROC_BROWSER_TEST_F(TwoClientLivePasswordsSyncTest,
+ SetPassphraseTwice) {
+#endif
+ ASSERT_TRUE(SetupSync()) << "SetupSync() failed.";
+
+ GetClient(0)->service()->SetPassphrase(kValidPassphrase, true);
+ GetClient(0)->AwaitPassphraseAccepted();
+ GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1));
+ ASSERT_TRUE(GetClient(1)->service()->observed_passphrase_required());
+
+ GetClient(1)->service()->SetPassphrase(kValidPassphrase, true);
+ GetClient(1)->AwaitPassphraseAccepted();
+ ASSERT_FALSE(GetClient(1)->service()->observed_passphrase_required());
+
+ GetClient(1)->service()->SetPassphrase(kValidPassphrase, true);
+ GetClient(1)->AwaitPassphraseAccepted();
+ ASSERT_FALSE(GetClient(1)->service()->observed_passphrase_required());
+}
« no previous file with comments | « chrome/browser/sync/profile_sync_service_harness.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698