OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "base/strings/string_util.h" | 5 #include "base/strings/string_util.h" |
6 #include "base/strings/utf_string_conversions.h" | 6 #include "base/strings/utf_string_conversions.h" |
7 #include "chrome/test/base/chrome_render_view_test.h" | 7 #include "chrome/test/base/chrome_render_view_test.h" |
8 #include "components/autofill/content/renderer/autofill_agent.h" | 8 #include "components/autofill/content/renderer/autofill_agent.h" |
9 #include "components/autofill/content/renderer/form_autofill_util.h" | 9 #include "components/autofill/content/renderer/form_autofill_util.h" |
10 #include "components/autofill/content/renderer/password_autofill_agent.h" | 10 #include "components/autofill/content/renderer/password_autofill_agent.h" |
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
301 password, | 301 password, |
302 password_autofilled, | 302 password_autofilled, |
303 false); | 303 false); |
304 } | 304 } |
305 | 305 |
306 void CheckUsernameSelection(int start, int end) { | 306 void CheckUsernameSelection(int start, int end) { |
307 EXPECT_EQ(start, username_element_.selectionStart()); | 307 EXPECT_EQ(start, username_element_.selectionStart()); |
308 EXPECT_EQ(end, username_element_.selectionEnd()); | 308 EXPECT_EQ(end, username_element_.selectionEnd()); |
309 } | 309 } |
310 | 310 |
311 string16 username1_; | 311 base::string16 username1_; |
312 string16 username2_; | 312 base::string16 username2_; |
313 string16 username3_; | 313 base::string16 username3_; |
314 string16 password1_; | 314 base::string16 password1_; |
315 string16 password2_; | 315 base::string16 password2_; |
316 string16 password3_; | 316 base::string16 password3_; |
317 string16 alternate_username3_; | 317 base::string16 alternate_username3_; |
318 PasswordFormFillData fill_data_; | 318 PasswordFormFillData fill_data_; |
319 | 319 |
320 WebInputElement username_element_; | 320 WebInputElement username_element_; |
321 WebInputElement password_element_; | 321 WebInputElement password_element_; |
322 | 322 |
323 private: | 323 private: |
324 DISALLOW_COPY_AND_ASSIGN(PasswordAutofillAgentTest); | 324 DISALLOW_COPY_AND_ASSIGN(PasswordAutofillAgentTest); |
325 }; | 325 }; |
326 | 326 |
327 // Tests that the password login is autocompleted as expected when the browser | 327 // Tests that the password login is autocompleted as expected when the browser |
(...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
830 // Verfies that a DOM-activated UI event will not cause an autofill. | 830 // Verfies that a DOM-activated UI event will not cause an autofill. |
831 TEST_F(PasswordAutofillAgentTest, NoDOMActivationTest) { | 831 TEST_F(PasswordAutofillAgentTest, NoDOMActivationTest) { |
832 // Trigger the initial autocomplete. | 832 // Trigger the initial autocomplete. |
833 SimulateOnFillPasswordForm(fill_data_); | 833 SimulateOnFillPasswordForm(fill_data_); |
834 | 834 |
835 ExecuteJavaScript(kJavaScriptClick); | 835 ExecuteJavaScript(kJavaScriptClick); |
836 CheckTextFieldsDOMState(kAliceUsername, true, "", true); | 836 CheckTextFieldsDOMState(kAliceUsername, true, "", true); |
837 } | 837 } |
838 | 838 |
839 } // namespace autofill | 839 } // namespace autofill |
OLD | NEW |