| 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 "base/strings/utf_string_conversions.h" | 5 #include "base/strings/utf_string_conversions.h" |
| 6 #include "chrome/browser/sync/test/integration/passwords_helper.h" | 6 #include "chrome/browser/sync/test/integration/passwords_helper.h" |
| 7 #include "chrome/browser/sync/test/integration/profile_sync_service_harness.h" | 7 #include "chrome/browser/sync/test/integration/profile_sync_service_harness.h" |
| 8 #include "chrome/browser/sync/test/integration/sync_test.h" | 8 #include "chrome/browser/sync/test/integration/sync_test.h" |
| 9 #include "sync/internal_api/public/engine/model_safe_worker.h" | 9 #include "sync/internal_api/public/engine/model_safe_worker.h" |
| 10 #include "sync/internal_api/public/sessions/sync_session_snapshot.h" | 10 #include "sync/internal_api/public/sessions/sync_session_snapshot.h" |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 } | 54 } |
| 55 | 55 |
| 56 IN_PROC_BROWSER_TEST_F(TwoClientPasswordsSyncTest, Race) { | 56 IN_PROC_BROWSER_TEST_F(TwoClientPasswordsSyncTest, Race) { |
| 57 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; | 57 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; |
| 58 ASSERT_TRUE(AllProfilesContainSamePasswordForms()); | 58 ASSERT_TRUE(AllProfilesContainSamePasswordForms()); |
| 59 | 59 |
| 60 PasswordForm form0 = CreateTestPasswordForm(0); | 60 PasswordForm form0 = CreateTestPasswordForm(0); |
| 61 AddLogin(GetPasswordStore(0), form0); | 61 AddLogin(GetPasswordStore(0), form0); |
| 62 | 62 |
| 63 PasswordForm form1 = form0; | 63 PasswordForm form1 = form0; |
| 64 form1.password_value = ASCIIToUTF16("new_password"); | 64 form1.password_value = base::ASCIIToUTF16("new_password"); |
| 65 AddLogin(GetPasswordStore(1), form1); | 65 AddLogin(GetPasswordStore(1), form1); |
| 66 | 66 |
| 67 ASSERT_TRUE(AwaitQuiescence()); | 67 ASSERT_TRUE(AwaitQuiescence()); |
| 68 ASSERT_TRUE(AllProfilesContainSamePasswordForms()); | 68 ASSERT_TRUE(AllProfilesContainSamePasswordForms()); |
| 69 } | 69 } |
| 70 | 70 |
| 71 // TCM ID - 4577932. | 71 // TCM ID - 4577932. |
| 72 IN_PROC_BROWSER_TEST_F(TwoClientPasswordsSyncTest, DisablePasswords) { | 72 IN_PROC_BROWSER_TEST_F(TwoClientPasswordsSyncTest, DisablePasswords) { |
| 73 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; | 73 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; |
| 74 ASSERT_TRUE(AllProfilesContainSamePasswordFormsAsVerifier()); | 74 ASSERT_TRUE(AllProfilesContainSamePasswordFormsAsVerifier()); |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 // TCM ID - 4603879 | 148 // TCM ID - 4603879 |
| 149 IN_PROC_BROWSER_TEST_F(TwoClientPasswordsSyncTest, Update) { | 149 IN_PROC_BROWSER_TEST_F(TwoClientPasswordsSyncTest, Update) { |
| 150 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; | 150 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; |
| 151 ASSERT_TRUE(AllProfilesContainSamePasswordFormsAsVerifier()); | 151 ASSERT_TRUE(AllProfilesContainSamePasswordFormsAsVerifier()); |
| 152 | 152 |
| 153 PasswordForm form = CreateTestPasswordForm(0); | 153 PasswordForm form = CreateTestPasswordForm(0); |
| 154 AddLogin(GetVerifierPasswordStore(), form); | 154 AddLogin(GetVerifierPasswordStore(), form); |
| 155 AddLogin(GetPasswordStore(0), form); | 155 AddLogin(GetPasswordStore(0), form); |
| 156 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); | 156 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); |
| 157 | 157 |
| 158 form.password_value = ASCIIToUTF16("new_password"); | 158 form.password_value = base::ASCIIToUTF16("new_password"); |
| 159 UpdateLogin(GetVerifierPasswordStore(), form); | 159 UpdateLogin(GetVerifierPasswordStore(), form); |
| 160 UpdateLogin(GetPasswordStore(1), form); | 160 UpdateLogin(GetPasswordStore(1), form); |
| 161 ASSERT_TRUE(AwaitQuiescence()); | 161 ASSERT_TRUE(AwaitQuiescence()); |
| 162 | 162 |
| 163 ASSERT_EQ(1, GetVerifierPasswordCount()); | 163 ASSERT_EQ(1, GetVerifierPasswordCount()); |
| 164 ASSERT_TRUE(AllProfilesContainSamePasswordFormsAsVerifier()); | 164 ASSERT_TRUE(AllProfilesContainSamePasswordFormsAsVerifier()); |
| 165 } | 165 } |
| 166 | 166 |
| 167 // TCM ID - 3719309 | 167 // TCM ID - 3719309 |
| 168 IN_PROC_BROWSER_TEST_F(TwoClientPasswordsSyncTest, Delete) { | 168 IN_PROC_BROWSER_TEST_F(TwoClientPasswordsSyncTest, Delete) { |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 ASSERT_FALSE(AllProfilesContainSamePasswordFormsAsVerifier()); | 279 ASSERT_FALSE(AllProfilesContainSamePasswordFormsAsVerifier()); |
| 280 | 280 |
| 281 // Update 1 with the correct passphrase, the password should now sync over. | 281 // Update 1 with the correct passphrase, the password should now sync over. |
| 282 ASSERT_TRUE(GetClient(1)->AwaitPassphraseRequired()); | 282 ASSERT_TRUE(GetClient(1)->AwaitPassphraseRequired()); |
| 283 ASSERT_TRUE(SetDecryptionPassphrase(1, kValidPassphrase)); | 283 ASSERT_TRUE(SetDecryptionPassphrase(1, kValidPassphrase)); |
| 284 ASSERT_TRUE(GetClient(1)->AwaitPassphraseAccepted()); | 284 ASSERT_TRUE(GetClient(1)->AwaitPassphraseAccepted()); |
| 285 | 285 |
| 286 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); | 286 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); |
| 287 ASSERT_TRUE(AllProfilesContainSamePasswordFormsAsVerifier()); | 287 ASSERT_TRUE(AllProfilesContainSamePasswordFormsAsVerifier()); |
| 288 } | 288 } |
| OLD | NEW |