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 "chrome/browser/ui/passwords/manage_passwords_test.h" | 5 #include "chrome/browser/ui/passwords/manage_passwords_test.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 | 58 |
59 void ManagePasswordsTest::SetupPendingPassword() { | 59 void ManagePasswordsTest::SetupPendingPassword() { |
60 password_manager::StubPasswordManagerClient client; | 60 password_manager::StubPasswordManagerClient client; |
61 password_manager::StubLogManager log_manager; | 61 password_manager::StubLogManager log_manager; |
62 password_manager::StubPasswordManagerDriver driver; | 62 password_manager::StubPasswordManagerDriver driver; |
63 | 63 |
64 std::unique_ptr<password_manager::PasswordFormManager> test_form_manager( | 64 std::unique_ptr<password_manager::PasswordFormManager> test_form_manager( |
65 new password_manager::PasswordFormManager( | 65 new password_manager::PasswordFormManager( |
66 nullptr, &client, driver.AsWeakPtr(), *test_form(), | 66 nullptr, &client, driver.AsWeakPtr(), *test_form(), |
67 base::WrapUnique(new password_manager::StubFormSaver))); | 67 base::WrapUnique(new password_manager::StubFormSaver))); |
68 test_form_manager->SimulateFetchMatchingLoginsFromPasswordStore(); | |
69 ScopedVector<autofill::PasswordForm> best_matches; | 68 ScopedVector<autofill::PasswordForm> best_matches; |
70 test_form_manager->OnGetPasswordStoreResults(std::move(best_matches)); | 69 test_form_manager->OnGetPasswordStoreResults(std::move(best_matches)); |
71 GetController()->OnPasswordSubmitted(std::move(test_form_manager)); | 70 GetController()->OnPasswordSubmitted(std::move(test_form_manager)); |
72 } | 71 } |
73 | 72 |
74 void ManagePasswordsTest::SetupAutomaticPassword() { | 73 void ManagePasswordsTest::SetupAutomaticPassword() { |
75 password_manager::StubPasswordManagerClient client; | 74 password_manager::StubPasswordManagerClient client; |
76 password_manager::StubLogManager log_manager; | 75 password_manager::StubLogManager log_manager; |
77 password_manager::StubPasswordManagerDriver driver; | 76 password_manager::StubPasswordManagerDriver driver; |
78 | 77 |
(...skipping 15 matching lines...) Expand all Loading... |
94 const char* histogram) { | 93 const char* histogram) { |
95 // Ensure that everything has been properly recorded before pulling samples. | 94 // Ensure that everything has been properly recorded before pulling samples. |
96 content::RunAllPendingInMessageLoop(); | 95 content::RunAllPendingInMessageLoop(); |
97 return histogram_tester_.GetHistogramSamplesSinceCreation(histogram); | 96 return histogram_tester_.GetHistogramSamplesSinceCreation(histogram); |
98 } | 97 } |
99 | 98 |
100 PasswordsClientUIDelegate* ManagePasswordsTest::GetController() { | 99 PasswordsClientUIDelegate* ManagePasswordsTest::GetController() { |
101 return PasswordsClientUIDelegateFromWebContents( | 100 return PasswordsClientUIDelegateFromWebContents( |
102 browser()->tab_strip_model()->GetActiveWebContents()); | 101 browser()->tab_strip_model()->GetActiveWebContents()); |
103 } | 102 } |
OLD | NEW |