| 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> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "base/metrics/histogram_samples.h" | 11 #include "base/metrics/histogram_samples.h" |
| 12 #include "base/test/histogram_tester.h" | 12 #include "base/test/histogram_tester.h" |
| 13 #include "chrome/test/base/in_process_browser_test.h" | 13 #include "chrome/test/base/in_process_browser_test.h" |
| 14 #include "components/autofill/core/common/password_form.h" | 14 #include "components/autofill/core/common/password_form.h" |
| 15 #include "components/password_manager/core/browser/fake_form_fetcher.h" | 15 #include "components/password_manager/core/browser/fake_form_fetcher.h" |
| 16 #include "components/password_manager/core/browser/stub_password_manager_client.
h" | 16 #include "components/password_manager/core/browser/stub_password_manager_client.
h" |
| 17 #include "components/password_manager/core/browser/stub_password_manager_driver.
h" | 17 #include "components/password_manager/core/browser/stub_password_manager_driver.
h" |
| 18 #include "components/password_manager/core/common/credential_manager_types.h" | 18 #include "components/password_manager/core/common/credential_manager_types.h" |
| 19 #include "testing/gmock/include/gmock/gmock.h" | 19 #include "testing/gmock/include/gmock/gmock.h" |
| 20 | 20 |
| 21 class ManagePasswordsIconView; | |
| 22 class PasswordsClientUIDelegate; | 21 class PasswordsClientUIDelegate; |
| 23 | 22 |
| 24 // Test class for the various password management view bits and pieces. Provides | 23 // Test class for the various password management view bits and pieces. Provides |
| 25 // some helper methods to poke at the bubble, icon, and controller's state. | 24 // some helper methods to poke at the bubble, icon, and controller's state. |
| 26 class ManagePasswordsTest : public InProcessBrowserTest { | 25 class ManagePasswordsTest : public InProcessBrowserTest { |
| 27 public: | 26 public: |
| 28 ManagePasswordsTest(); | 27 ManagePasswordsTest(); |
| 29 ~ManagePasswordsTest(); | 28 ~ManagePasswordsTest(); |
| 30 | 29 |
| 31 // InProcessBrowserTest: | 30 // InProcessBrowserTest: |
| 32 void SetUpOnMainThread() override; | 31 void SetUpOnMainThread() override; |
| 33 | 32 |
| 34 // Get the icon view for the current WebContents. | |
| 35 virtual ManagePasswordsIconView* view() = 0; | |
| 36 | |
| 37 // Execute the browser command to open the manage passwords bubble. | 33 // Execute the browser command to open the manage passwords bubble. |
| 38 void ExecuteManagePasswordsCommand(); | 34 void ExecuteManagePasswordsCommand(); |
| 39 | 35 |
| 40 // Put the controller, icon, and bubble into a managing-password state. | 36 // Put the controller, icon, and bubble into a managing-password state. |
| 41 void SetupManagingPasswords(); | 37 void SetupManagingPasswords(); |
| 42 | 38 |
| 43 // Put the controller, icon, and bubble into the confirmation state. | 39 // Put the controller, icon, and bubble into the confirmation state. |
| 44 void SetupAutomaticPassword(); | 40 void SetupAutomaticPassword(); |
| 45 | 41 |
| 46 // Put the controller, icon, and bubble into a pending-password state. | 42 // Put the controller, icon, and bubble into a pending-password state. |
| (...skipping 18 matching lines...) Expand all Loading... |
| 65 autofill::PasswordForm test_form_; | 61 autofill::PasswordForm test_form_; |
| 66 base::HistogramTester histogram_tester_; | 62 base::HistogramTester histogram_tester_; |
| 67 password_manager::StubPasswordManagerClient client_; | 63 password_manager::StubPasswordManagerClient client_; |
| 68 password_manager::StubPasswordManagerDriver driver_; | 64 password_manager::StubPasswordManagerDriver driver_; |
| 69 password_manager::FakeFormFetcher fetcher_; | 65 password_manager::FakeFormFetcher fetcher_; |
| 70 | 66 |
| 71 DISALLOW_COPY_AND_ASSIGN(ManagePasswordsTest); | 67 DISALLOW_COPY_AND_ASSIGN(ManagePasswordsTest); |
| 72 }; | 68 }; |
| 73 | 69 |
| 74 #endif // CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_TEST_H_ | 70 #endif // CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_TEST_H_ |
| OLD | NEW |