Chromium Code Reviews| Index: components/password_manager/core/browser/credential_manager_password_form_manager_unittest.cc |
| diff --git a/components/password_manager/core/browser/credential_manager_password_form_manager_unittest.cc b/components/password_manager/core/browser/credential_manager_password_form_manager_unittest.cc |
| index 88caa117d772fa4a573639161b2a0e000bc819ee..8aedf6b9edc41bd334059dd0b86ea9d055c58931 100644 |
| --- a/components/password_manager/core/browser/credential_manager_password_form_manager_unittest.cc |
| +++ b/components/password_manager/core/browser/credential_manager_password_form_manager_unittest.cc |
| @@ -3,6 +3,7 @@ |
| // found in the LICENSE file. |
| #include "components/password_manager/core/browser/credential_manager_password_form_manager.h" |
| +#include <base/memory/ref_counted.h> |
|
vasilii
2017/05/29 13:15:48
Improper place and style for the include (no <>)
kolos1
2017/05/29 15:47:06
Done.
|
| #include <memory> |
| @@ -50,12 +51,14 @@ class CredentialManagerPasswordFormManagerTest : public testing::Test { |
| TEST_F(CredentialManagerPasswordFormManagerTest, AbortEarly) { |
| PasswordForm observed_form; |
| MockDelegate delegate; |
| - auto form_manager = base::MakeUnique<CredentialManagerPasswordFormManager>( |
| - &client_, driver_.AsWeakPtr(), observed_form, |
| - base::MakeUnique<PasswordForm>(observed_form), &delegate, |
| - base::MakeUnique<StubFormSaver>(), base::MakeUnique<FakeFormFetcher>()); |
| - |
| - auto deleter = [&form_manager]() { form_manager.reset(); }; |
| + auto form_manager = |
| + base::MakeRefCounted<CredentialManagerPasswordFormManager>( |
| + &client_, driver_.AsWeakPtr(), observed_form, |
| + base::MakeUnique<PasswordForm>(observed_form), &delegate, |
| + base::MakeUnique<StubFormSaver>(), |
| + base::MakeUnique<FakeFormFetcher>()); |
| + |
| + auto deleter = [&form_manager]() { form_manager = nullptr; }; |
| // Simulate that the PasswordStore responded to the FormFetcher. As a result, |
| // |form_manager| should call the delegate's OnProvisionalSaveComplete, which |