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 #ifndef CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_TEST_H_ | 5 #ifndef CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_TEST_H_ |
6 #define CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_TEST_H_ | 6 #define CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_TEST_H_ |
7 | 7 |
| 8 #include <memory> |
| 9 |
8 #include "base/macros.h" | 10 #include "base/macros.h" |
9 #include "base/memory/scoped_ptr.h" | |
10 #include "base/memory/scoped_vector.h" | 11 #include "base/memory/scoped_vector.h" |
11 #include "base/metrics/histogram_samples.h" | 12 #include "base/metrics/histogram_samples.h" |
12 #include "base/test/histogram_tester.h" | 13 #include "base/test/histogram_tester.h" |
13 #include "chrome/test/base/in_process_browser_test.h" | 14 #include "chrome/test/base/in_process_browser_test.h" |
14 #include "components/autofill/core/common/password_form.h" | 15 #include "components/autofill/core/common/password_form.h" |
15 #include "components/password_manager/core/common/credential_manager_types.h" | 16 #include "components/password_manager/core/common/credential_manager_types.h" |
16 #include "testing/gmock/include/gmock/gmock.h" | 17 #include "testing/gmock/include/gmock/gmock.h" |
17 | 18 |
18 class GURL; | 19 class GURL; |
19 class ManagePasswordsIconView; | 20 class ManagePasswordsIconView; |
(...skipping 22 matching lines...) Expand all Loading... |
42 void SetupAutomaticPassword(); | 43 void SetupAutomaticPassword(); |
43 | 44 |
44 // Put the controller, icon, and bubble into a pending-password state. | 45 // Put the controller, icon, and bubble into a pending-password state. |
45 void SetupPendingPassword(); | 46 void SetupPendingPassword(); |
46 | 47 |
47 // Put the controller, icon, and bubble into an auto sign-in state. | 48 // Put the controller, icon, and bubble into an auto sign-in state. |
48 void SetupAutoSignin( | 49 void SetupAutoSignin( |
49 ScopedVector<autofill::PasswordForm> local_credentials); | 50 ScopedVector<autofill::PasswordForm> local_credentials); |
50 | 51 |
51 // Get samples for |histogram|. | 52 // Get samples for |histogram|. |
52 scoped_ptr<base::HistogramSamples> GetSamples(const char* histogram); | 53 std::unique_ptr<base::HistogramSamples> GetSamples(const char* histogram); |
53 | 54 |
54 autofill::PasswordForm* test_form() { return &test_form_; } | 55 autofill::PasswordForm* test_form() { return &test_form_; } |
55 | 56 |
56 // Get the UI controller for the current WebContents. | 57 // Get the UI controller for the current WebContents. |
57 PasswordsClientUIDelegate* GetController(); | 58 PasswordsClientUIDelegate* GetController(); |
58 | 59 |
59 MOCK_METHOD1(OnChooseCredential, | 60 MOCK_METHOD1(OnChooseCredential, |
60 void(const password_manager::CredentialInfo&)); | 61 void(const password_manager::CredentialInfo&)); |
61 | 62 |
62 private: | 63 private: |
63 autofill::PasswordForm test_form_; | 64 autofill::PasswordForm test_form_; |
64 base::HistogramTester histogram_tester_; | 65 base::HistogramTester histogram_tester_; |
65 | 66 |
66 DISALLOW_COPY_AND_ASSIGN(ManagePasswordsTest); | 67 DISALLOW_COPY_AND_ASSIGN(ManagePasswordsTest); |
67 }; | 68 }; |
68 | 69 |
69 #endif // CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_TEST_H_ | 70 #endif // CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_TEST_H_ |
OLD | NEW |