| 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 <vector> | 5 #include <vector> |
| 6 | 6 |
| 7 #include "base/format_macros.h" | 7 #include "base/format_macros.h" |
| 8 #include "base/metrics/field_trial.h" | 8 #include "base/metrics/field_trial.h" |
| 9 #include "base/strings/string16.h" | 9 #include "base/strings/string16.h" |
| 10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 | 251 |
| 252 const WebString expected_value = ASCIIToUTF16(field_case.expected_value); | 252 const WebString expected_value = ASCIIToUTF16(field_case.expected_value); |
| 253 if (expected_value.isEmpty()) | 253 if (expected_value.isEmpty()) |
| 254 EXPECT_TRUE(value.isEmpty()); | 254 EXPECT_TRUE(value.isEmpty()); |
| 255 else | 255 else |
| 256 EXPECT_EQ(expected_value, value); | 256 EXPECT_EQ(expected_value, value); |
| 257 | 257 |
| 258 EXPECT_EQ(field_case.should_be_autofilled, element.isAutofilled()); | 258 EXPECT_EQ(field_case.should_be_autofilled, element.isAutofilled()); |
| 259 } | 259 } |
| 260 | 260 |
| 261 static void FillFormForAllFieldsWrapper(const FormData& form, | |
| 262 const WebInputElement& element) { | |
| 263 FillFormForAllElements(form, element.form()); | |
| 264 } | |
| 265 | |
| 266 static void FillFormIncludingNonFocusableElementsWrapper( | 261 static void FillFormIncludingNonFocusableElementsWrapper( |
| 267 const FormData& form, | 262 const FormData& form, |
| 268 const WebFormControlElement& element) { | 263 const WebFormControlElement& element) { |
| 269 FillFormIncludingNonFocusableElements(form, element.form()); | 264 FillFormIncludingNonFocusableElements(form, element.form()); |
| 270 } | 265 } |
| 271 | 266 |
| 272 static WebString GetValueWrapper(WebFormControlElement element) { | 267 static WebString GetValueWrapper(WebFormControlElement element) { |
| 273 if (element.formControlType() == "textarea") | 268 if (element.formControlType() == "textarea") |
| 274 return element.to<WebTextAreaElement>().value(); | 269 return element.to<WebTextAreaElement>().value(); |
| 275 | 270 |
| (...skipping 3405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3681 expected.max_length = WebInputElement::defaultMaxLength(); | 3676 expected.max_length = WebInputElement::defaultMaxLength(); |
| 3682 EXPECT_FORM_FIELD_DATA_EQUALS(expected, fields[1]); | 3677 EXPECT_FORM_FIELD_DATA_EQUALS(expected, fields[1]); |
| 3683 | 3678 |
| 3684 expected.name = ASCIIToUTF16("country"); | 3679 expected.name = ASCIIToUTF16("country"); |
| 3685 expected.value = ASCIIToUTF16("AL"); | 3680 expected.value = ASCIIToUTF16("AL"); |
| 3686 expected.form_control_type = "select-one"; | 3681 expected.form_control_type = "select-one"; |
| 3687 expected.max_length = 0; | 3682 expected.max_length = 0; |
| 3688 EXPECT_FORM_FIELD_DATA_EQUALS(expected, fields[2]); | 3683 EXPECT_FORM_FIELD_DATA_EQUALS(expected, fields[2]); |
| 3689 } | 3684 } |
| 3690 } // namespace autofill | 3685 } // namespace autofill |
| OLD | NEW |