| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_UI_CONTROLLER_MOCK_H_ | 5 #ifndef CHROME_BROWSER_UI_PASSWORDS_PASSWORDS_MODEL_DELEGATE_MOCK_H_ |
| 6 #define CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_UI_CONTROLLER_MOCK_H_ | 6 #define CHROME_BROWSER_UI_PASSWORDS_PASSWORDS_MODEL_DELEGATE_MOCK_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "chrome/browser/ui/passwords/manage_passwords_ui_controller.h" | 9 #include "base/memory/weak_ptr.h" |
| 10 #include "chrome/browser/ui/passwords/passwords_model_delegate.h" |
| 10 #include "testing/gmock/include/gmock/gmock.h" | 11 #include "testing/gmock/include/gmock/gmock.h" |
| 11 | 12 |
| 12 namespace content { | 13 class PasswordsModelDelegateMock |
| 13 class WebContents; | 14 : public PasswordsModelDelegate, |
| 14 } // namespace content | 15 public base::SupportsWeakPtr<PasswordsModelDelegateMock>{ |
| 16 public: |
| 17 PasswordsModelDelegateMock(); |
| 18 ~PasswordsModelDelegateMock() override; |
| 15 | 19 |
| 16 class ManagePasswordsUIControllerMock : public ManagePasswordsUIController { | 20 MOCK_CONST_METHOD0(GetWebContents, content::WebContents*()); |
| 17 public: | |
| 18 explicit ManagePasswordsUIControllerMock( | |
| 19 content::WebContents* contents); | |
| 20 ~ManagePasswordsUIControllerMock() override; | |
| 21 | |
| 22 MOCK_CONST_METHOD0(GetOrigin, const GURL&()); | 21 MOCK_CONST_METHOD0(GetOrigin, const GURL&()); |
| 23 MOCK_CONST_METHOD0(GetState, password_manager::ui::State()); | 22 MOCK_CONST_METHOD0(GetState, password_manager::ui::State()); |
| 24 MOCK_CONST_METHOD0(GetPendingPassword, const autofill::PasswordForm&()); | 23 MOCK_CONST_METHOD0(GetPendingPassword, const autofill::PasswordForm&()); |
| 25 MOCK_CONST_METHOD0(IsPasswordOverridden, bool()); | 24 MOCK_CONST_METHOD0(IsPasswordOverridden, bool()); |
| 26 MOCK_CONST_METHOD0(GetCurrentForms, | 25 MOCK_CONST_METHOD0(GetCurrentForms, |
| 27 const std::vector<const autofill::PasswordForm*>&()); | 26 const std::vector<const autofill::PasswordForm*>&()); |
| 28 MOCK_CONST_METHOD0(GetFederatedForms, | 27 MOCK_CONST_METHOD0(GetFederatedForms, |
| 29 const std::vector<const autofill::PasswordForm*>&()); | 28 const std::vector<const autofill::PasswordForm*>&()); |
| 30 MOCK_CONST_METHOD0(GetCurrentInteractionStats, | 29 MOCK_CONST_METHOD0(GetCurrentInteractionStats, |
| 31 password_manager::InteractionsStats*()); | 30 password_manager::InteractionsStats*()); |
| 32 MOCK_METHOD0(OnBubbleShown, void()); | 31 MOCK_METHOD0(OnBubbleShown, void()); |
| 33 MOCK_METHOD0(OnBubbleHidden, void()); | 32 MOCK_METHOD0(OnBubbleHidden, void()); |
| 34 MOCK_METHOD0(OnNoInteractionOnUpdate, void()); | 33 MOCK_METHOD0(OnNoInteractionOnUpdate, void()); |
| 35 MOCK_METHOD0(OnNopeUpdateClicked, void()); | 34 MOCK_METHOD0(OnNopeUpdateClicked, void()); |
| 36 MOCK_METHOD0(NeverSavePassword, void()); | 35 MOCK_METHOD0(NeverSavePassword, void()); |
| 37 MOCK_METHOD0(SavePassword, void()); | 36 MOCK_METHOD0(SavePassword, void()); |
| 38 MOCK_METHOD1(UpdatePassword, void(const autofill::PasswordForm&)); | 37 MOCK_METHOD1(UpdatePassword, void(const autofill::PasswordForm&)); |
| 39 MOCK_METHOD2(ChooseCredential, | 38 MOCK_METHOD2(ChooseCredential, void(const autofill::PasswordForm&, |
| 40 void(autofill::PasswordForm, password_manager::CredentialType)); | 39 password_manager::CredentialType)); |
| 41 MOCK_METHOD0(NavigateToExternalPasswordManager, void()); | 40 MOCK_METHOD0(NavigateToExternalPasswordManager, void()); |
| 42 MOCK_METHOD0(NavigateToSmartLockPage, void()); | 41 MOCK_METHOD0(NavigateToSmartLockPage, void()); |
| 43 MOCK_METHOD0(NavigateToSmartLockHelpPage, void()); | 42 MOCK_METHOD0(NavigateToSmartLockHelpPage, void()); |
| 44 MOCK_METHOD0(NavigateToPasswordManagerSettingsPage, void()); | 43 MOCK_METHOD0(NavigateToPasswordManagerSettingsPage, void()); |
| 45 MOCK_METHOD0(NavigateToChromeSignIn, void()); | 44 MOCK_METHOD0(NavigateToChromeSignIn, void()); |
| 46 MOCK_METHOD0(OnDialogHidden, void()); | 45 MOCK_METHOD0(OnDialogHidden, void()); |
| 47 | 46 |
| 48 private: | 47 private: |
| 49 DISALLOW_COPY_AND_ASSIGN(ManagePasswordsUIControllerMock); | 48 DISALLOW_COPY_AND_ASSIGN(PasswordsModelDelegateMock); |
| 50 }; | 49 }; |
| 51 | 50 |
| 52 #endif // CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_UI_CONTROLLER_MOCK_H_ | 51 #endif // CHROME_BROWSER_UI_PASSWORDS_PASSWORDS_MODEL_DELEGATE_MOCK_H_ |
| OLD | NEW |