Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10)

Side by Side Diff: chrome/renderer/autofill/form_autofill_browsertest.cc

Issue 2022123002: Merge autofill::FormFieldData::is_checkable and is_checked (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | components/autofill/content/common/autofill_messages.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <stddef.h> 5 #include <stddef.h>
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/format_macros.h" 9 #include "base/format_macros.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 1693 matching lines...) Expand 10 before | Expand all | Expand 10 after
1704 WebInputElement element = GetInputElementById("checkbox"); 1704 WebInputElement element = GetInputElementById("checkbox");
1705 element.setAutofilled(true); 1705 element.setAutofilled(true);
1706 FormFieldData result; 1706 FormFieldData result;
1707 WebFormControlElementToFormField(element, EXTRACT_VALUE, &result); 1707 WebFormControlElementToFormField(element, EXTRACT_VALUE, &result);
1708 1708
1709 FormFieldData expected; 1709 FormFieldData expected;
1710 expected.name = ASCIIToUTF16("checkbox"); 1710 expected.name = ASCIIToUTF16("checkbox");
1711 expected.value = ASCIIToUTF16("mail"); 1711 expected.value = ASCIIToUTF16("mail");
1712 expected.form_control_type = "checkbox"; 1712 expected.form_control_type = "checkbox";
1713 expected.is_autofilled = true; 1713 expected.is_autofilled = true;
1714 expected.is_checkable = true; 1714 expected.check_status = FormFieldData::CHECKED;
1715 expected.is_checked = true;
1716 EXPECT_FORM_FIELD_DATA_EQUALS(expected, result); 1715 EXPECT_FORM_FIELD_DATA_EQUALS(expected, result);
1717 1716
1718 element = GetInputElementById("radio"); 1717 element = GetInputElementById("radio");
1719 element.setAutofilled(true); 1718 element.setAutofilled(true);
1720 WebFormControlElementToFormField(element, EXTRACT_VALUE, &result); 1719 WebFormControlElementToFormField(element, EXTRACT_VALUE, &result);
1721 expected.name = ASCIIToUTF16("radio"); 1720 expected.name = ASCIIToUTF16("radio");
1722 expected.value = ASCIIToUTF16("male"); 1721 expected.value = ASCIIToUTF16("male");
1723 expected.form_control_type = "radio"; 1722 expected.form_control_type = "radio";
1724 expected.is_autofilled = true; 1723 expected.is_autofilled = true;
1725 expected.is_checkable = true; 1724 expected.check_status = FormFieldData::CHECKABLE_BUT_UNCHECKED;
1726 expected.is_checked = false;
1727 EXPECT_FORM_FIELD_DATA_EQUALS(expected, result); 1725 EXPECT_FORM_FIELD_DATA_EQUALS(expected, result);
1728 } 1726 }
1729 1727
1730 // We should be able to extract a <select> field. 1728 // We should be able to extract a <select> field.
1731 TEST_F(FormAutofillTest, WebFormControlElementToFormFieldSelect) { 1729 TEST_F(FormAutofillTest, WebFormControlElementToFormFieldSelect) {
1732 LoadHTML("<SELECT id='element'/>" 1730 LoadHTML("<SELECT id='element'/>"
1733 " <OPTION value='CA'>California</OPTION>" 1731 " <OPTION value='CA'>California</OPTION>"
1734 " <OPTION value='TX'>Texas</OPTION>" 1732 " <OPTION value='TX'>Texas</OPTION>"
1735 "</SELECT>"); 1733 "</SELECT>");
1736 1734
(...skipping 2845 matching lines...) Expand 10 before | Expand all | Expand 10 after
4582 4580
4583 if (test_case.has_extracted_form) { 4581 if (test_case.has_extracted_form) {
4584 EXPECT_EQ(test_case.is_form_tag, forms[0].is_form_tag); 4582 EXPECT_EQ(test_case.is_form_tag, forms[0].is_form_tag);
4585 EXPECT_EQ(test_case.is_formless_checkout, forms[0].is_formless_checkout); 4583 EXPECT_EQ(test_case.is_formless_checkout, forms[0].is_formless_checkout);
4586 } 4584 }
4587 } 4585 }
4588 } 4586 }
4589 4587
4590 } // namespace form_util 4588 } // namespace form_util
4591 } // namespace autofill 4589 } // namespace autofill
OLDNEW
« no previous file with comments | « no previous file | components/autofill/content/common/autofill_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698