| 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 <sstream> | 7 #include <sstream> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 base::WaitableEvent wait_event( | 88 base::WaitableEvent wait_event( |
| 89 base::WaitableEvent::ResetPolicy::MANUAL, | 89 base::WaitableEvent::ResetPolicy::MANUAL, |
| 90 base::WaitableEvent::InitialState::NOT_SIGNALED); | 90 base::WaitableEvent::InitialState::NOT_SIGNALED); |
| 91 store->UpdateLogin(form); | 91 store->UpdateLogin(form); |
| 92 store->ScheduleTask(base::Bind(&PasswordStoreCallback, &wait_event)); | 92 store->ScheduleTask(base::Bind(&PasswordStoreCallback, &wait_event)); |
| 93 wait_event.Wait(); | 93 wait_event.Wait(); |
| 94 } | 94 } |
| 95 | 95 |
| 96 ScopedVector<PasswordForm> GetLogins(PasswordStore* store) { | 96 ScopedVector<PasswordForm> GetLogins(PasswordStore* store) { |
| 97 EXPECT_TRUE(store); | 97 EXPECT_TRUE(store); |
| 98 PasswordForm matcher_form; | 98 password_manager::PasswordStore::FormDigest matcher_form = { |
| 99 matcher_form.signon_realm = kFakeSignonRealm; | 99 PasswordForm::SCHEME_HTML, kFakeSignonRealm, GURL()}; |
| 100 PasswordStoreConsumerHelper consumer; | 100 PasswordStoreConsumerHelper consumer; |
| 101 store->GetLogins(matcher_form, &consumer); | 101 store->GetLogins(matcher_form, &consumer); |
| 102 content::RunMessageLoop(); | 102 content::RunMessageLoop(); |
| 103 return consumer.result(); | 103 return consumer.result(); |
| 104 } | 104 } |
| 105 | 105 |
| 106 void RemoveLogin(PasswordStore* store, const PasswordForm& form) { | 106 void RemoveLogin(PasswordStore* store, const PasswordForm& form) { |
| 107 ASSERT_TRUE(store); | 107 ASSERT_TRUE(store); |
| 108 base::WaitableEvent wait_event( | 108 base::WaitableEvent wait_event( |
| 109 base::WaitableEvent::ResetPolicy::MANUAL, | 109 base::WaitableEvent::ResetPolicy::MANUAL, |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 350 form.origin = GURL(base::StringPrintf(kIndexedFakeOrigin, index)); | 350 form.origin = GURL(base::StringPrintf(kIndexedFakeOrigin, index)); |
| 351 form.username_value = | 351 form.username_value = |
| 352 base::ASCIIToUTF16(base::StringPrintf("username%d", index)); | 352 base::ASCIIToUTF16(base::StringPrintf("username%d", index)); |
| 353 form.password_value = | 353 form.password_value = |
| 354 base::ASCIIToUTF16(base::StringPrintf("password%d", index)); | 354 base::ASCIIToUTF16(base::StringPrintf("password%d", index)); |
| 355 form.date_created = base::Time::Now(); | 355 form.date_created = base::Time::Now(); |
| 356 return form; | 356 return form; |
| 357 } | 357 } |
| 358 | 358 |
| 359 } // namespace passwords_helper | 359 } // namespace passwords_helper |
| OLD | NEW |