| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/string16.h" | 5 #include "base/strings/string16.h" |
| 6 #include "base/strings/string_util.h" | 6 #include "base/strings/string_util.h" |
| 7 #include "base/strings/stringprintf.h" | 7 #include "base/strings/stringprintf.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #include "components/autofill/content/renderer/password_form_conversion_utils.h" | 9 #include "components/autofill/content/renderer/password_form_conversion_utils.h" |
| 10 #include "components/autofill/core/common/password_form.h" | 10 #include "components/autofill/core/common/password_form.h" |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 ASSERT_EQ(1U, forms.size()); | 127 ASSERT_EQ(1U, forms.size()); |
| 128 | 128 |
| 129 WebVector<WebFormControlElement> control_elements; | 129 WebVector<WebFormControlElement> control_elements; |
| 130 forms[0].getFormControlElements(control_elements); | 130 forms[0].getFormControlElements(control_elements); |
| 131 for (size_t i = 0; i < control_elements.size(); ++i) { | 131 for (size_t i = 0; i < control_elements.size(); ++i) { |
| 132 WebInputElement* input_element = toWebInputElement(&control_elements[i]); | 132 WebInputElement* input_element = toWebInputElement(&control_elements[i]); |
| 133 if (input_element->hasAttribute("set-activated-submit")) | 133 if (input_element->hasAttribute("set-activated-submit")) |
| 134 input_element->setActivatedSubmit(true); | 134 input_element->setActivatedSubmit(true); |
| 135 } | 135 } |
| 136 | 136 |
| 137 *password_form = CreatePasswordForm(forms[0], nullptr); | 137 *password_form = CreatePasswordForm(forms[0], nullptr, nullptr); |
| 138 } | 138 } |
| 139 | 139 |
| 140 private: | 140 private: |
| 141 DISALLOW_COPY_AND_ASSIGN(PasswordFormConversionUtilsTest); | 141 DISALLOW_COPY_AND_ASSIGN(PasswordFormConversionUtilsTest); |
| 142 }; | 142 }; |
| 143 | 143 |
| 144 } // namespace | 144 } // namespace |
| 145 | 145 |
| 146 TEST_F(PasswordFormConversionUtilsTest, BasicFormAttributes) { | 146 TEST_F(PasswordFormConversionUtilsTest, BasicFormAttributes) { |
| 147 PasswordFormBuilder builder(kTestFormActionURL); | 147 PasswordFormBuilder builder(kTestFormActionURL); |
| (...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 677 | 677 |
| 678 scoped_ptr<PasswordForm> login_plus_signup_form; | 678 scoped_ptr<PasswordForm> login_plus_signup_form; |
| 679 ASSERT_NO_FATAL_FAILURE( | 679 ASSERT_NO_FATAL_FAILURE( |
| 680 LoadHTMLAndConvertForm(login_plus_signup_html, &login_plus_signup_form)); | 680 LoadHTMLAndConvertForm(login_plus_signup_html, &login_plus_signup_form)); |
| 681 ASSERT_TRUE(login_plus_signup_form); | 681 ASSERT_TRUE(login_plus_signup_form); |
| 682 EXPECT_EQ(PasswordForm::Layout::LAYOUT_LOGIN_AND_SIGNUP, | 682 EXPECT_EQ(PasswordForm::Layout::LAYOUT_LOGIN_AND_SIGNUP, |
| 683 login_plus_signup_form->layout); | 683 login_plus_signup_form->layout); |
| 684 } | 684 } |
| 685 | 685 |
| 686 } // namespace autofill | 686 } // namespace autofill |
| OLD | NEW |