OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <memory> | 5 #include <memory> |
6 #include <utility> | 6 #include <utility> |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 } | 233 } |
234 | 234 |
235 std::unique_ptr<password_manager::PasswordFormManager> | 235 std::unique_ptr<password_manager::PasswordFormManager> |
236 ManagePasswordsUIControllerTest::CreateFormManagerWithBestMatches( | 236 ManagePasswordsUIControllerTest::CreateFormManagerWithBestMatches( |
237 const autofill::PasswordForm& observed_form, | 237 const autofill::PasswordForm& observed_form, |
238 ScopedVector<autofill::PasswordForm> best_matches) { | 238 ScopedVector<autofill::PasswordForm> best_matches) { |
239 std::unique_ptr<password_manager::PasswordFormManager> test_form_manager( | 239 std::unique_ptr<password_manager::PasswordFormManager> test_form_manager( |
240 new password_manager::PasswordFormManager( | 240 new password_manager::PasswordFormManager( |
241 &password_manager_, &client_, driver_.AsWeakPtr(), observed_form, | 241 &password_manager_, &client_, driver_.AsWeakPtr(), observed_form, |
242 base::WrapUnique(new password_manager::StubFormSaver))); | 242 base::WrapUnique(new password_manager::StubFormSaver))); |
243 test_form_manager->SimulateFetchMatchingLoginsFromPasswordStore(); | |
244 test_form_manager->OnGetPasswordStoreResults(std::move(best_matches)); | 243 test_form_manager->OnGetPasswordStoreResults(std::move(best_matches)); |
245 return test_form_manager; | 244 return test_form_manager; |
246 } | 245 } |
247 | 246 |
248 std::unique_ptr<password_manager::PasswordFormManager> | 247 std::unique_ptr<password_manager::PasswordFormManager> |
249 ManagePasswordsUIControllerTest::CreateFormManager() { | 248 ManagePasswordsUIControllerTest::CreateFormManager() { |
250 ScopedVector<autofill::PasswordForm> stored_forms; | 249 ScopedVector<autofill::PasswordForm> stored_forms; |
251 stored_forms.push_back(new autofill::PasswordForm(test_local_form())); | 250 stored_forms.push_back(new autofill::PasswordForm(test_local_form())); |
252 return CreateFormManagerWithBestMatches(test_local_form(), | 251 return CreateFormManagerWithBestMatches(test_local_form(), |
253 std::move(stored_forms)); | 252 std::move(stored_forms)); |
(...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
762 // Open the bubble again. | 761 // Open the bubble again. |
763 local_credentials.push_back(new autofill::PasswordForm(test_local_form())); | 762 local_credentials.push_back(new autofill::PasswordForm(test_local_form())); |
764 EXPECT_CALL(*controller(), OnUpdateBubbleAndIconVisibility()); | 763 EXPECT_CALL(*controller(), OnUpdateBubbleAndIconVisibility()); |
765 controller()->OnAutoSignin(std::move(local_credentials), | 764 controller()->OnAutoSignin(std::move(local_credentials), |
766 test_local_form().origin); | 765 test_local_form().origin); |
767 EXPECT_EQ(password_manager::ui::AUTO_SIGNIN_STATE, controller()->GetState()); | 766 EXPECT_EQ(password_manager::ui::AUTO_SIGNIN_STATE, controller()->GetState()); |
768 // Check the delegate is destroyed. Thus, the first bubble has no way to mess | 767 // Check the delegate is destroyed. Thus, the first bubble has no way to mess |
769 // up with the controller's state. | 768 // up with the controller's state. |
770 EXPECT_FALSE(proxy_delegate); | 769 EXPECT_FALSE(proxy_delegate); |
771 } | 770 } |
OLD | NEW |