OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <stdint.h> | 5 #include <stdint.h> |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 | 8 |
9 #include "base/guid.h" | 9 #include "base/guid.h" |
10 #include "base/hash.h" | 10 #include "base/hash.h" |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
146 IN_PROC_BROWSER_TEST_F(TwoClientPasswordsSyncTest, | 146 IN_PROC_BROWSER_TEST_F(TwoClientPasswordsSyncTest, |
147 SetPassphraseAndThenSetupSync) { | 147 SetPassphraseAndThenSetupSync) { |
148 ASSERT_TRUE(SetupClients()); | 148 ASSERT_TRUE(SetupClients()); |
149 | 149 |
150 ASSERT_TRUE(GetClient(0)->SetupSync()); | 150 ASSERT_TRUE(GetClient(0)->SetupSync()); |
151 SetEncryptionPassphrase(0, kValidPassphrase, ProfileSyncService::EXPLICIT); | 151 SetEncryptionPassphrase(0, kValidPassphrase, ProfileSyncService::EXPLICIT); |
152 ASSERT_TRUE(AwaitPassphraseAccepted(GetSyncService(0))); | 152 ASSERT_TRUE(AwaitPassphraseAccepted(GetSyncService(0))); |
153 | 153 |
154 // When client 1 hits a passphrase required state, we can infer that | 154 // When client 1 hits a passphrase required state, we can infer that |
155 // client 0's passphrase has been committed. to the server. | 155 // client 0's passphrase has been committed. to the server. |
156 GetClient(1)->SetupSync(); | 156 ASSERT_FALSE(GetClient(1)->SetupSync()); |
157 ASSERT_TRUE(AwaitPassphraseRequired(GetSyncService(1))); | 157 ASSERT_TRUE(AwaitPassphraseRequired(GetSyncService(1))); |
158 | 158 |
159 // Get client 1 out of the passphrase required state. | 159 // Get client 1 out of the passphrase required state. |
160 ASSERT_TRUE(SetDecryptionPassphrase(1, kValidPassphrase)); | 160 ASSERT_TRUE(SetDecryptionPassphrase(1, kValidPassphrase)); |
161 ASSERT_TRUE(AwaitPassphraseAccepted(GetSyncService(1))); | 161 ASSERT_TRUE(AwaitPassphraseAccepted(GetSyncService(1))); |
162 | 162 |
163 // For some reason, the tests won't pass unless these flags are set. | 163 // We must mark the first setup complete now, since we just entered the |
164 // passphrase and the previous SetupSync() call failed. | |
164 GetSyncService(1)->SetFirstSetupComplete(); | 165 GetSyncService(1)->SetFirstSetupComplete(); |
maxbogue
2016/06/09 20:04:13
Shouldn't this just use ProfileSyncServiceHarness:
tommycli
2016/06/10 00:04:15
Done.
| |
165 GetSyncService(1)->SetSetupInProgress(false); | |
166 | 166 |
167 // Move around some passwords to make sure it's all working. | 167 // Move around some passwords to make sure it's all working. |
168 PasswordForm form0 = CreateTestPasswordForm(0); | 168 PasswordForm form0 = CreateTestPasswordForm(0); |
169 AddLogin(GetPasswordStore(0), form0); | 169 AddLogin(GetPasswordStore(0), form0); |
170 | 170 |
171 ASSERT_TRUE(AwaitAllProfilesContainSamePasswordForms()); | 171 ASSERT_TRUE(AwaitAllProfilesContainSamePasswordForms()); |
172 } | 172 } |
173 | 173 |
174 IN_PROC_BROWSER_TEST_F(TwoClientPasswordsSyncTest, E2E_ONLY(Delete)) { | 174 IN_PROC_BROWSER_TEST_F(TwoClientPasswordsSyncTest, E2E_ONLY(Delete)) { |
175 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; | 175 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
258 | 258 |
259 // Blocks and waits for password forms in all profiles to match. | 259 // Blocks and waits for password forms in all profiles to match. |
260 ASSERT_TRUE(AwaitAllProfilesContainSamePasswordForms()); | 260 ASSERT_TRUE(AwaitAllProfilesContainSamePasswordForms()); |
261 | 261 |
262 // Check that total number of passwords is as expected. | 262 // Check that total number of passwords is as expected. |
263 for (int i = 0; i < num_clients(); ++i) { | 263 for (int i = 0; i < num_clients(); ++i) { |
264 ASSERT_EQ(GetPasswordCount(i), init_password_count + num_clients()) << | 264 ASSERT_EQ(GetPasswordCount(i), init_password_count + num_clients()) << |
265 "Total password count is wrong."; | 265 "Total password count is wrong."; |
266 } | 266 } |
267 } | 267 } |
OLD | NEW |