| 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 "components/password_manager/core/browser/password_store_consumer.h" |
| 12 #include "content/public/browser/web_contents_observer.h" | 13 #include "content/public/browser/web_contents_observer.h" |
| 13 #include "content/public/test/test_utils.h" | 14 #include "content/public/test/test_utils.h" |
| 14 | 15 |
| 15 namespace autofill { | 16 namespace autofill { |
| 16 struct PasswordForm; | 17 struct PasswordForm; |
| 17 } | 18 } |
| 18 | 19 |
| 19 class ManagePasswordsUIController; | 20 class ManagePasswordsUIController; |
| 20 | 21 |
| 21 class NavigationObserver : public content::WebContentsObserver { | 22 class NavigationObserver : public content::WebContentsObserver { |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 // equal to |expected_value|. If the current value is not as expected, this | 116 // equal to |expected_value|. If the current value is not as expected, this |
| 116 // waits until the "change" event is fired for the element. This also | 117 // waits until the "change" event is fired for the element. This also |
| 117 // guarantees that once the real value matches the expected, the JavaScript | 118 // guarantees that once the real value matches the expected, the JavaScript |
| 118 // event loop is spun to allow all other possible events to take place. | 119 // event loop is spun to allow all other possible events to take place. |
| 119 void WaitForElementValue(const std::string& element_id, | 120 void WaitForElementValue(const std::string& element_id, |
| 120 const std::string& expected_value); | 121 const std::string& expected_value); |
| 121 // Same as above except the element |element_id| is in iframe |iframe_id| | 122 // Same as above except the element |element_id| is in iframe |iframe_id| |
| 122 void WaitForElementValue(const std::string& iframe_id, | 123 void WaitForElementValue(const std::string& iframe_id, |
| 123 const std::string& element_id, | 124 const std::string& element_id, |
| 124 const std::string& expected_value); | 125 const std::string& expected_value); |
| 126 // Make sure that the password store processed all the previous calls which |
| 127 // are executed on another thread. |
| 128 void WaitForPasswordStore(); |
| 125 // Checks that the current "value" attribute of the HTML element with | 129 // Checks that the current "value" attribute of the HTML element with |
| 126 // |element_id| is equal to |expected_value|. | 130 // |element_id| is equal to |expected_value|. |
| 127 void CheckElementValue(const std::string& element_id, | 131 void CheckElementValue(const std::string& element_id, |
| 128 const std::string& expected_value); | 132 const std::string& expected_value); |
| 129 // Same as above except the element |element_id| is in iframe |iframe_id| | 133 // Same as above except the element |element_id| is in iframe |iframe_id| |
| 130 void CheckElementValue(const std::string& iframe_id, | 134 void CheckElementValue(const std::string& iframe_id, |
| 131 const std::string& element_id, | 135 const std::string& element_id, |
| 132 const std::string& expected_value); | 136 const std::string& expected_value); |
| 133 | 137 |
| 134 // Accessors | 138 // Accessors |
| 135 content::WebContents* WebContents(); | 139 content::WebContents* WebContents(); |
| 136 content::RenderViewHost* RenderViewHost(); | 140 content::RenderViewHost* RenderViewHost(); |
| 137 | 141 |
| 138 private: | 142 private: |
| 139 DISALLOW_COPY_AND_ASSIGN(PasswordManagerBrowserTestBase); | 143 DISALLOW_COPY_AND_ASSIGN(PasswordManagerBrowserTestBase); |
| 140 }; | 144 }; |
| 141 | 145 |
| 142 #endif // CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_MANAGER_TEST_BASE_H_ | 146 #endif // CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_MANAGER_TEST_BASE_H_ |
| OLD | NEW |