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