| 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 "chrome/browser/sync/test/integration/passwords_helper.h" | 5 #include "chrome/browser/sync/test/integration/passwords_helper.h" |
| 6 | 6 |
| 7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
| 8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "base/synchronization/waitable_event.h" | 10 #include "base/synchronization/waitable_event.h" |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 test()->GetProfile(index))->SetEncryptionPassphrase(passphrase, type); | 127 test()->GetProfile(index))->SetEncryptionPassphrase(passphrase, type); |
| 128 } | 128 } |
| 129 | 129 |
| 130 bool SetDecryptionPassphrase(int index, const std::string& passphrase) { | 130 bool SetDecryptionPassphrase(int index, const std::string& passphrase) { |
| 131 return ProfileSyncServiceFactory::GetForProfile( | 131 return ProfileSyncServiceFactory::GetForProfile( |
| 132 test()->GetProfile(index))->SetDecryptionPassphrase(passphrase); | 132 test()->GetProfile(index))->SetDecryptionPassphrase(passphrase); |
| 133 } | 133 } |
| 134 | 134 |
| 135 PasswordStore* GetPasswordStore(int index) { | 135 PasswordStore* GetPasswordStore(int index) { |
| 136 return PasswordStoreFactory::GetForProfile(test()->GetProfile(index), | 136 return PasswordStoreFactory::GetForProfile(test()->GetProfile(index), |
| 137 Profile::IMPLICIT_ACCESS).get(); | 137 ServiceAccessType::IMPLICIT_ACCESS) |
| 138 .get(); |
| 138 } | 139 } |
| 139 | 140 |
| 140 PasswordStore* GetVerifierPasswordStore() { | 141 PasswordStore* GetVerifierPasswordStore() { |
| 141 return PasswordStoreFactory::GetForProfile(test()->verifier(), | 142 return PasswordStoreFactory::GetForProfile( |
| 142 Profile::IMPLICIT_ACCESS).get(); | 143 test()->verifier(), ServiceAccessType::IMPLICIT_ACCESS).get(); |
| 143 } | 144 } |
| 144 | 145 |
| 145 bool ProfileContainsSamePasswordFormsAsVerifier(int index) { | 146 bool ProfileContainsSamePasswordFormsAsVerifier(int index) { |
| 146 std::vector<PasswordForm> verifier_forms; | 147 std::vector<PasswordForm> verifier_forms; |
| 147 std::vector<PasswordForm> forms; | 148 std::vector<PasswordForm> forms; |
| 148 GetLogins(GetVerifierPasswordStore(), verifier_forms); | 149 GetLogins(GetVerifierPasswordStore(), verifier_forms); |
| 149 GetLogins(GetPasswordStore(index), forms); | 150 GetLogins(GetPasswordStore(index), forms); |
| 150 ClearSyncDateField(&forms); | 151 ClearSyncDateField(&forms); |
| 151 bool result = | 152 bool result = |
| 152 password_manager::ContainsSamePasswordForms(verifier_forms, forms); | 153 password_manager::ContainsSamePasswordForms(verifier_forms, forms); |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 360 form.origin = GURL(base::StringPrintf(kIndexedFakeOrigin, index)); | 361 form.origin = GURL(base::StringPrintf(kIndexedFakeOrigin, index)); |
| 361 form.username_value = | 362 form.username_value = |
| 362 base::ASCIIToUTF16(base::StringPrintf("username%d", index)); | 363 base::ASCIIToUTF16(base::StringPrintf("username%d", index)); |
| 363 form.password_value = | 364 form.password_value = |
| 364 base::ASCIIToUTF16(base::StringPrintf("password%d", index)); | 365 base::ASCIIToUTF16(base::StringPrintf("password%d", index)); |
| 365 form.date_created = base::Time::Now(); | 366 form.date_created = base::Time::Now(); |
| 366 return form; | 367 return form; |
| 367 } | 368 } |
| 368 | 369 |
| 369 } // namespace passwords_helper | 370 } // namespace passwords_helper |
| OLD | NEW |