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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/sync/profile_sync_service_harness.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/password_manager/password_form_data.h" 5 #include "chrome/browser/password_manager/password_form_data.h"
6 #include "chrome/browser/sync/sessions/session_state.h" 6 #include "chrome/browser/sync/sessions/session_state.h"
7 #include "chrome/test/live_sync/live_passwords_sync_test.h" 7 #include "chrome/test/live_sync/live_passwords_sync_test.h"
8 8
9 using webkit_glue::PasswordForm; 9 using webkit_glue::PasswordForm;
10 10
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 ASSERT_EQ(1, GetClient(1)->GetLastSessionSnapshot()-> 117 ASSERT_EQ(1, GetClient(1)->GetLastSessionSnapshot()->
118 num_conflicting_updates); 118 num_conflicting_updates);
119 119
120 GetClient(1)->service()->SetPassphrase(kValidPassphrase, true); 120 GetClient(1)->service()->SetPassphrase(kValidPassphrase, true);
121 GetClient(1)->AwaitPassphraseAccepted(); 121 GetClient(1)->AwaitPassphraseAccepted();
122 ASSERT_FALSE(GetClient(1)->service()->observed_passphrase_required()); 122 ASSERT_FALSE(GetClient(1)->service()->observed_passphrase_required());
123 GetClient(1)->AwaitSyncCycleCompletion("Accept passphrase and decrypt."); 123 GetClient(1)->AwaitSyncCycleCompletion("Accept passphrase and decrypt.");
124 ASSERT_EQ(0, GetClient(1)->GetLastSessionSnapshot()-> 124 ASSERT_EQ(0, GetClient(1)->GetLastSessionSnapshot()->
125 num_conflicting_updates); 125 num_conflicting_updates);
126 } 126 }
127
128 // TODO(sync): Remove FAILS_ annotation after http://crbug.com/59867 is fixed.
129 #if defined(OS_MACOSX)
130 IN_PROC_BROWSER_TEST_F(TwoClientLivePasswordsSyncTest,
131 FAILS_SetPassphraseAndThenSetupSync) {
132 #else
133 IN_PROC_BROWSER_TEST_F(TwoClientLivePasswordsSyncTest,
134 SetPassphraseAndThenSetupSync) {
135 #endif
136 ASSERT_TRUE(SetupClients()) << "SetupClients() failed.";
137 ASSERT_TRUE(GetClient(0)->SetupSync());
138 GetClient(0)->service()->SetPassphrase(kValidPassphrase, true);
139 GetClient(0)->AwaitPassphraseAccepted();
140 GetClient(0)->AwaitSyncCycleCompletion("Initial sync.");
141
142 ASSERT_TRUE(GetClient(1)->SetupSync());
143 ASSERT_TRUE(AwaitQuiescence());
144 ASSERT_TRUE(GetClient(1)->service()->observed_passphrase_required());
145 GetClient(1)->service()->SetPassphrase(kValidPassphrase, true);
146 GetClient(1)->AwaitPassphraseAccepted();
147 ASSERT_FALSE(GetClient(1)->service()->observed_passphrase_required());
148 }
149
150 // TODO(sync): Remove FAILS_ annotation after http://crbug.com/59867 is fixed.
151 #if defined(OS_MACOSX)
152 IN_PROC_BROWSER_TEST_F(TwoClientLivePasswordsSyncTest,
153 FAILS_SetPassphraseTwice) {
154 #else
155 IN_PROC_BROWSER_TEST_F(TwoClientLivePasswordsSyncTest,
156 SetPassphraseTwice) {
157 #endif
158 ASSERT_TRUE(SetupSync()) << "SetupSync() failed.";
159
160 GetClient(0)->service()->SetPassphrase(kValidPassphrase, true);
161 GetClient(0)->AwaitPassphraseAccepted();
162 GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1));
163 ASSERT_TRUE(GetClient(1)->service()->observed_passphrase_required());
164
165 GetClient(1)->service()->SetPassphrase(kValidPassphrase, true);
166 GetClient(1)->AwaitPassphraseAccepted();
167 ASSERT_FALSE(GetClient(1)->service()->observed_passphrase_required());
168
169 GetClient(1)->service()->SetPassphrase(kValidPassphrase, true);
170 GetClient(1)->AwaitPassphraseAccepted();
171 ASSERT_FALSE(GetClient(1)->service()->observed_passphrase_required());
172 }
OLDNEW
« 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