Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(273)

Side by Side Diff: chrome/browser/ui/passwords/manage_passwords_state_unittest.cc

Issue 2252283005: Introduce password_manager::FormFetcher (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@621355_const_best_matches
Patch Set: Keep updating PasswordStore for blacklisting Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <iterator> 7 #include <iterator>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 new password_manager::PasswordFormManager( 131 new password_manager::PasswordFormManager(
132 &password_manager_, &stub_client_, driver_.AsWeakPtr(), 132 &password_manager_, &stub_client_, driver_.AsWeakPtr(),
133 test_local_form(), 133 test_local_form(),
134 base::WrapUnique(new password_manager::StubFormSaver))); 134 base::WrapUnique(new password_manager::StubFormSaver)));
135 if (include_federated) { 135 if (include_federated) {
136 test_stored_forms_.push_back( 136 test_stored_forms_.push_back(
137 base::MakeUnique<autofill::PasswordForm>(test_local_federated_form())); 137 base::MakeUnique<autofill::PasswordForm>(test_local_federated_form()));
138 } 138 }
139 test_form_manager->OnGetPasswordStoreResults(std::move(test_stored_forms_)); 139 test_form_manager->OnGetPasswordStoreResults(std::move(test_stored_forms_));
140 EXPECT_EQ(include_federated ? 1u : 0u, 140 EXPECT_EQ(include_federated ? 1u : 0u,
141 test_form_manager->federated_matches().size()); 141 test_form_manager->form_fetcher()->GetFederatedMatches().size());
142 if (include_federated) { 142 if (include_federated) {
143 EXPECT_EQ(test_local_federated_form(), 143 EXPECT_EQ(
144 *test_form_manager->federated_matches().front()); 144 test_local_federated_form(),
145 *test_form_manager->form_fetcher()->GetFederatedMatches().front());
145 } 146 }
146 return test_form_manager; 147 return test_form_manager;
147 } 148 }
148 149
149 void ManagePasswordsStateTest::TestNoisyUpdates() { 150 void ManagePasswordsStateTest::TestNoisyUpdates() {
150 const std::vector<const autofill::PasswordForm*> forms = 151 const std::vector<const autofill::PasswordForm*> forms =
151 GetRawPointers(passwords_data_.GetCurrentForms()); 152 GetRawPointers(passwords_data_.GetCurrentForms());
152 const std::vector<const autofill::PasswordForm*> federated_forms = 153 const std::vector<const autofill::PasswordForm*> federated_forms =
153 GetRawPointers(passwords_data_.federation_providers_forms()); 154 GetRawPointers(passwords_data_.federation_providers_forms());
154 const password_manager::ui::State state = passwords_data_.state(); 155 const password_manager::ui::State state = passwords_data_.state();
(...skipping 536 matching lines...) Expand 10 before | Expand all | Expand 10 after
691 std::vector<std::unique_ptr<autofill::PasswordForm>>(), 692 std::vector<std::unique_ptr<autofill::PasswordForm>>(),
692 std::vector<std::unique_ptr<autofill::PasswordForm>>(), 693 std::vector<std::unique_ptr<autofill::PasswordForm>>(),
693 test_local_form().origin); 694 test_local_form().origin);
694 passwords_data().set_credentials_callback(base::Bind( 695 passwords_data().set_credentials_callback(base::Bind(
695 &ManagePasswordsStateTest::CredentialCallback, base::Unretained(this))); 696 &ManagePasswordsStateTest::CredentialCallback, base::Unretained(this)));
696 EXPECT_CALL(*this, CredentialCallback(&test_local_federated_form())); 697 EXPECT_CALL(*this, CredentialCallback(&test_local_federated_form()));
697 passwords_data().ChooseCredential(&test_local_federated_form()); 698 passwords_data().ChooseCredential(&test_local_federated_form());
698 } 699 }
699 700
700 } // namespace 701 } // namespace
OLDNEW
« no previous file with comments | « chrome/browser/ui/passwords/manage_passwords_state.cc ('k') | chrome/browser/ui/passwords/manage_passwords_ui_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698