| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/ui/passwords/manage_passwords_state.h" | 5 #include "chrome/browser/ui/passwords/manage_passwords_state.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 return CreateFormManagerInternal(true); | 114 return CreateFormManagerInternal(true); |
| 115 } | 115 } |
| 116 | 116 |
| 117 std::unique_ptr<password_manager::PasswordFormManager> | 117 std::unique_ptr<password_manager::PasswordFormManager> |
| 118 ManagePasswordsStateTest::CreateFormManagerInternal(bool include_federated) { | 118 ManagePasswordsStateTest::CreateFormManagerInternal(bool include_federated) { |
| 119 std::unique_ptr<password_manager::PasswordFormManager> test_form_manager( | 119 std::unique_ptr<password_manager::PasswordFormManager> test_form_manager( |
| 120 new password_manager::PasswordFormManager( | 120 new password_manager::PasswordFormManager( |
| 121 &password_manager_, &stub_client_, driver_.AsWeakPtr(), | 121 &password_manager_, &stub_client_, driver_.AsWeakPtr(), |
| 122 test_local_form(), | 122 test_local_form(), |
| 123 base::WrapUnique(new password_manager::StubFormSaver))); | 123 base::WrapUnique(new password_manager::StubFormSaver))); |
| 124 test_form_manager->SimulateFetchMatchingLoginsFromPasswordStore(); | |
| 125 if (include_federated) { | 124 if (include_federated) { |
| 126 test_stored_forms_.push_back( | 125 test_stored_forms_.push_back( |
| 127 new autofill::PasswordForm(test_local_federated_form())); | 126 new autofill::PasswordForm(test_local_federated_form())); |
| 128 } | 127 } |
| 129 test_form_manager->OnGetPasswordStoreResults(std::move(test_stored_forms_)); | 128 test_form_manager->OnGetPasswordStoreResults(std::move(test_stored_forms_)); |
| 130 EXPECT_EQ(include_federated ? 1u : 0u, | 129 EXPECT_EQ(include_federated ? 1u : 0u, |
| 131 test_form_manager->federated_matches().size()); | 130 test_form_manager->federated_matches().size()); |
| 132 if (include_federated) { | 131 if (include_federated) { |
| 133 EXPECT_EQ(test_local_federated_form(), | 132 EXPECT_EQ(test_local_federated_form(), |
| 134 *test_form_manager->federated_matches().front()); | 133 *test_form_manager->federated_matches().front()); |
| (...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 678 passwords_data().OnRequestCredentials(ScopedVector<autofill::PasswordForm>(), | 677 passwords_data().OnRequestCredentials(ScopedVector<autofill::PasswordForm>(), |
| 679 ScopedVector<autofill::PasswordForm>(), | 678 ScopedVector<autofill::PasswordForm>(), |
| 680 test_local_form().origin); | 679 test_local_form().origin); |
| 681 passwords_data().set_credentials_callback(base::Bind( | 680 passwords_data().set_credentials_callback(base::Bind( |
| 682 &ManagePasswordsStateTest::CredentialCallback, base::Unretained(this))); | 681 &ManagePasswordsStateTest::CredentialCallback, base::Unretained(this))); |
| 683 EXPECT_CALL(*this, CredentialCallback(&test_local_federated_form())); | 682 EXPECT_CALL(*this, CredentialCallback(&test_local_federated_form())); |
| 684 passwords_data().ChooseCredential(&test_local_federated_form()); | 683 passwords_data().ChooseCredential(&test_local_federated_form()); |
| 685 } | 684 } |
| 686 | 685 |
| 687 } // namespace | 686 } // namespace |
| OLD | NEW |