| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_PASSWORD_MANAGER_PASSWORD_MANAGER_TEST_BASE_H_ | 5 #ifndef CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_MANAGER_TEST_BASE_H_ |
| 6 #define CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_MANAGER_TEST_BASE_H_ | 6 #define CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_MANAGER_TEST_BASE_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "chrome/test/base/in_process_browser_test.h" | 11 #include "chrome/test/base/in_process_browser_test.h" |
| 12 #include "content/public/browser/web_contents_observer.h" | 12 #include "content/public/browser/web_contents_observer.h" |
| 13 #include "content/public/test/test_utils.h" | 13 #include "content/public/test/test_utils.h" |
| 14 | 14 |
| 15 namespace autofill { | 15 namespace autofill { |
| 16 struct PasswordForm; | 16 struct PasswordForm; |
| 17 } | 17 } |
| 18 | 18 |
| 19 class PasswordsModelDelegate; | 19 class ManagePasswordsUIController; |
| 20 | 20 |
| 21 class NavigationObserver : public content::WebContentsObserver { | 21 class NavigationObserver : public content::WebContentsObserver { |
| 22 public: | 22 public: |
| 23 explicit NavigationObserver(content::WebContents* web_contents); | 23 explicit NavigationObserver(content::WebContents* web_contents); |
| 24 ~NavigationObserver() override; | 24 ~NavigationObserver() override; |
| 25 | 25 |
| 26 // Normally Wait() will not return until a main frame navigation occurs. | 26 // Normally Wait() will not return until a main frame navigation occurs. |
| 27 // If a path is set, Wait() will return after this path has been seen, | 27 // If a path is set, Wait() will return after this path has been seen, |
| 28 // regardless of the frame that navigated. Useful for multi-frame pages. | 28 // regardless of the frame that navigated. Useful for multi-frame pages. |
| 29 void SetPathToWaitFor(const std::string& path) { wait_for_path_ = path; } | 29 void SetPathToWaitFor(const std::string& path) { wait_for_path_ = path; } |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 | 74 |
| 75 // Expecting that the prompt is shown, saves the password. Checks that the | 75 // Expecting that the prompt is shown, saves the password. Checks that the |
| 76 // prompt is no longer visible afterwards. | 76 // prompt is no longer visible afterwards. |
| 77 void AcceptSavePrompt() const; | 77 void AcceptSavePrompt() const; |
| 78 | 78 |
| 79 // Expecting that the prompt is shown, update |form| with the password from | 79 // Expecting that the prompt is shown, update |form| with the password from |
| 80 // observed form. Checks that the prompt is no longer visible afterwards. | 80 // observed form. Checks that the prompt is no longer visible afterwards. |
| 81 void AcceptUpdatePrompt(const autofill::PasswordForm& form) const; | 81 void AcceptUpdatePrompt(const autofill::PasswordForm& form) const; |
| 82 | 82 |
| 83 private: | 83 private: |
| 84 PasswordsModelDelegate* const passwords_model_delegate_; | 84 ManagePasswordsUIController* const passwords_ui_controller_; |
| 85 | 85 |
| 86 DISALLOW_COPY_AND_ASSIGN(BubbleObserver); | 86 DISALLOW_COPY_AND_ASSIGN(BubbleObserver); |
| 87 }; | 87 }; |
| 88 | 88 |
| 89 class PasswordManagerBrowserTestBase : public InProcessBrowserTest { | 89 class PasswordManagerBrowserTestBase : public InProcessBrowserTest { |
| 90 public: | 90 public: |
| 91 PasswordManagerBrowserTestBase(); | 91 PasswordManagerBrowserTestBase(); |
| 92 ~PasswordManagerBrowserTestBase() override; | 92 ~PasswordManagerBrowserTestBase() override; |
| 93 | 93 |
| 94 // InProcessBrowserTest: | 94 // InProcessBrowserTest: |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 | 133 |
| 134 // Accessors | 134 // Accessors |
| 135 content::WebContents* WebContents(); | 135 content::WebContents* WebContents(); |
| 136 content::RenderViewHost* RenderViewHost(); | 136 content::RenderViewHost* RenderViewHost(); |
| 137 | 137 |
| 138 private: | 138 private: |
| 139 DISALLOW_COPY_AND_ASSIGN(PasswordManagerBrowserTestBase); | 139 DISALLOW_COPY_AND_ASSIGN(PasswordManagerBrowserTestBase); |
| 140 }; | 140 }; |
| 141 | 141 |
| 142 #endif // CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_MANAGER_TEST_BASE_H_ | 142 #endif // CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_MANAGER_TEST_BASE_H_ |
| OLD | NEW |