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" |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 void VerifyPasswordIsSavedAndFilled(const std::string& filename, | 130 void VerifyPasswordIsSavedAndFilled(const std::string& filename, |
131 const std::string& submission_script, | 131 const std::string& submission_script, |
132 const std::string& expected_element, | 132 const std::string& expected_element, |
133 const std::string& expected_value); | 133 const std::string& expected_value); |
134 | 134 |
135 // Waits until the "value" attribute of the HTML element with |element_id| is | 135 // Waits until the "value" attribute of the HTML element with |element_id| is |
136 // equal to |expected_value|. If the current value is not as expected, this | 136 // equal to |expected_value|. If the current value is not as expected, this |
137 // waits until the "change" event is fired for the element. This also | 137 // waits until the "change" event is fired for the element. This also |
138 // guarantees that once the real value matches the expected, the JavaScript | 138 // guarantees that once the real value matches the expected, the JavaScript |
139 // event loop is spun to allow all other possible events to take place. | 139 // event loop is spun to allow all other possible events to take place. |
| 140 // WARNING: |
| 141 // - the function waits only for the first "onchange" event. |
| 142 // - "onchange" event is triggered by autofill. However, if user's typing is |
| 143 // simulated then the event is triggered only when control looses focus. |
140 void WaitForElementValue(const std::string& element_id, | 144 void WaitForElementValue(const std::string& element_id, |
141 const std::string& expected_value); | 145 const std::string& expected_value); |
142 // Same as above except the element |element_id| is in iframe |iframe_id| | 146 // Same as above except the element |element_id| is in iframe |iframe_id| |
143 void WaitForElementValue(const std::string& iframe_id, | 147 void WaitForElementValue(const std::string& iframe_id, |
144 const std::string& element_id, | 148 const std::string& element_id, |
145 const std::string& expected_value); | 149 const std::string& expected_value); |
146 // Make sure that the password store processed all the previous calls which | 150 // Make sure that the password store processed all the previous calls which |
147 // are executed on another thread. | 151 // are executed on another thread. |
148 void WaitForPasswordStore(); | 152 void WaitForPasswordStore(); |
149 // Checks that the current "value" attribute of the HTML element with | 153 // Checks that the current "value" attribute of the HTML element with |
(...skipping 18 matching lines...) Expand all Loading... |
168 | 172 |
169 private: | 173 private: |
170 net::EmbeddedTestServer https_test_server_; | 174 net::EmbeddedTestServer https_test_server_; |
171 net::MockCertVerifier mock_cert_verifier_; | 175 net::MockCertVerifier mock_cert_verifier_; |
172 // A tab with some hooks injected. | 176 // A tab with some hooks injected. |
173 content::WebContents* web_contents_; | 177 content::WebContents* web_contents_; |
174 DISALLOW_COPY_AND_ASSIGN(PasswordManagerBrowserTestBase); | 178 DISALLOW_COPY_AND_ASSIGN(PasswordManagerBrowserTestBase); |
175 }; | 179 }; |
176 | 180 |
177 #endif // CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_MANAGER_TEST_BASE_H_ | 181 #endif // CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_MANAGER_TEST_BASE_H_ |
OLD | NEW |