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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 password_manager::StubPasswordManagerDriver driver; | 76 password_manager::StubPasswordManagerDriver driver; |
77 | 77 |
78 std::unique_ptr<password_manager::PasswordFormManager> test_form_manager( | 78 std::unique_ptr<password_manager::PasswordFormManager> test_form_manager( |
79 new password_manager::PasswordFormManager( | 79 new password_manager::PasswordFormManager( |
80 nullptr, &client, driver.AsWeakPtr(), *test_form(), | 80 nullptr, &client, driver.AsWeakPtr(), *test_form(), |
81 base::WrapUnique(new password_manager::StubFormSaver))); | 81 base::WrapUnique(new password_manager::StubFormSaver))); |
82 GetController()->OnAutomaticPasswordSave(std::move(test_form_manager)); | 82 GetController()->OnAutomaticPasswordSave(std::move(test_form_manager)); |
83 } | 83 } |
84 | 84 |
85 void ManagePasswordsTest::SetupAutoSignin( | 85 void ManagePasswordsTest::SetupAutoSignin( |
86 ScopedVector<autofill::PasswordForm> local_credentials) { | 86 std::vector<std::unique_ptr<autofill::PasswordForm>> local_credentials) { |
87 ASSERT_FALSE(local_credentials.empty()); | 87 ASSERT_FALSE(local_credentials.empty()); |
88 GURL origin = local_credentials[0]->origin; | 88 GURL origin = local_credentials[0]->origin; |
89 GetController()->OnAutoSignin(std::move(local_credentials), origin); | 89 GetController()->OnAutoSignin(std::move(local_credentials), origin); |
90 } | 90 } |
91 | 91 |
92 std::unique_ptr<base::HistogramSamples> ManagePasswordsTest::GetSamples( | 92 std::unique_ptr<base::HistogramSamples> ManagePasswordsTest::GetSamples( |
93 const char* histogram) { | 93 const char* histogram) { |
94 // Ensure that everything has been properly recorded before pulling samples. | 94 // Ensure that everything has been properly recorded before pulling samples. |
95 content::RunAllPendingInMessageLoop(); | 95 content::RunAllPendingInMessageLoop(); |
96 return histogram_tester_.GetHistogramSamplesSinceCreation(histogram); | 96 return histogram_tester_.GetHistogramSamplesSinceCreation(histogram); |
97 } | 97 } |
98 | 98 |
99 PasswordsClientUIDelegate* ManagePasswordsTest::GetController() { | 99 PasswordsClientUIDelegate* ManagePasswordsTest::GetController() { |
100 return PasswordsClientUIDelegateFromWebContents( | 100 return PasswordsClientUIDelegateFromWebContents( |
101 browser()->tab_strip_model()->GetActiveWebContents()); | 101 browser()->tab_strip_model()->GetActiveWebContents()); |
102 } | 102 } |
OLD | NEW |