Commit 2239f82c authored by Matthias Körber's avatar Matthias Körber Committed by Commit Bot

[Autofill] Remove finch guard to import unfocusable fields

Change-Id: Ie48947eb4686c46f110f0f033f16390c5cbcfd75
Bug: 1101280
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2506575
Commit-Queue: Matthias Körber <koerber@google.com>
Reviewed-by: default avatarChristoph Schwering <schwering@google.com>
Cr-Commit-Position: refs/heads/master@{#822853}
parent c088829b
...@@ -542,14 +542,8 @@ bool FormDataImporter::ImportAddressProfileForSection( ...@@ -542,14 +542,8 @@ bool FormDataImporter::ImportAddressProfileForSection(
base::TrimWhitespace(field->value, base::TRIM_ALL, &value); base::TrimWhitespace(field->value, base::TRIM_ALL, &value);
// If we don't know the type of the field, or the user hasn't entered any // If we don't know the type of the field, or the user hasn't entered any
// information into the field, or the field is non-focusable (hidden), then // information into the field, then skip it.
// skip it. if (!field->IsFieldFillable() || value.empty())
// TODO(crbug.com/1101280): Remove |skip_unfocussable_field|
bool skip_unfocussable_field =
!field->is_focusable &&
!base::FeatureList::IsEnabled(
features::kAutofillProfileImportFromUnfocusableFields);
if (!field->IsFieldFillable() || skip_unfocussable_field || value.empty())
continue; continue;
AutofillType field_type = field->Type(); AutofillType field_type = field->Type();
......
...@@ -832,7 +832,9 @@ TEST_P(FormDataImporterTest, ...@@ -832,7 +832,9 @@ TEST_P(FormDataImporterTest,
EXPECT_EQ(0, expected.Compare(*results[0])); EXPECT_EQ(0, expected.Compare(*results[0]));
} }
TEST_P(FormDataImporterTest, ImportAddressProfiles_UnFocussableFields) { // Test that a form is imported correctly even if some fields are not
// focusable.
TEST_P(FormDataImporterTest, ImportAddressProfiles_WithUnFocussableFields) {
FormData form; FormData form;
form.url = GURL("https://wwww.foo.com"); form.url = GURL("https://wwww.foo.com");
...@@ -854,7 +856,8 @@ TEST_P(FormDataImporterTest, ImportAddressProfiles_UnFocussableFields) { ...@@ -854,7 +856,8 @@ TEST_P(FormDataImporterTest, ImportAddressProfiles_UnFocussableFields) {
form.fields.push_back(field); form.fields.push_back(field);
test::CreateTestFormField("City:", "city", "San Francisco", "text", &field); test::CreateTestFormField("City:", "city", "San Francisco", "text", &field);
// Set this field to be unfocusable.
// Set this field to be not focusable.
field.is_focusable = false; field.is_focusable = false;
form.fields.push_back(field); form.fields.push_back(field);
...@@ -867,18 +870,6 @@ TEST_P(FormDataImporterTest, ImportAddressProfiles_UnFocussableFields) { ...@@ -867,18 +870,6 @@ TEST_P(FormDataImporterTest, ImportAddressProfiles_UnFocussableFields) {
FormStructure form_structure(form); FormStructure form_structure(form);
form_structure.DetermineHeuristicTypes(); form_structure.DetermineHeuristicTypes();
// Verify the status quo that the form is not imported with the unfocusable
// fields.
// TODO(crbug.com/1101280): Remove once feature is launched.
scoped_feature_list_.Reset();
scoped_feature_list_.InitAndDisableFeature(
features::kAutofillProfileImportFromUnfocusableFields);
ImportAddressProfiles(/*extraction_successful=*/false, form_structure);
// Activate the feature and test again.
scoped_feature_list_.Reset();
scoped_feature_list_.InitAndEnableFeature(
features::kAutofillProfileImportFromUnfocusableFields);
ImportAddressProfiles(/*extraction_successful=*/true, form_structure); ImportAddressProfiles(/*extraction_successful=*/true, form_structure);
AutofillProfile expected(base::GenerateGUID(), test::kEmptyOrigin); AutofillProfile expected(base::GenerateGUID(), test::kEmptyOrigin);
......
...@@ -210,11 +210,6 @@ const base::Feature kAutofillProbableFormSubmissionInBrowser{ ...@@ -210,11 +210,6 @@ const base::Feature kAutofillProbableFormSubmissionInBrowser{
const base::Feature kAutofillProfileClientValidation{ const base::Feature kAutofillProfileClientValidation{
"AutofillProfileClientValidation", base::FEATURE_DISABLED_BY_DEFAULT}; "AutofillProfileClientValidation", base::FEATURE_DISABLED_BY_DEFAULT};
// TODO(crbug.com/1101280): Remove once feature is tested.
const base::Feature kAutofillProfileImportFromUnfocusableFields{
"AutofillProfileImportFromUnfocusableFields",
base::FEATURE_DISABLED_BY_DEFAULT};
// Controls whether Autofill uses server-side validation to ensure that fields // Controls whether Autofill uses server-side validation to ensure that fields
// with invalid data are not suggested. // with invalid data are not suggested.
const base::Feature kAutofillProfileServerValidation{ const base::Feature kAutofillProfileServerValidation{
......
...@@ -58,7 +58,6 @@ extern const base::Feature kAutofillOffNoServerData; ...@@ -58,7 +58,6 @@ extern const base::Feature kAutofillOffNoServerData;
extern const base::Feature kAutofillPreventMixedFormsFilling; extern const base::Feature kAutofillPreventMixedFormsFilling;
extern const base::Feature kAutofillProbableFormSubmissionInBrowser; extern const base::Feature kAutofillProbableFormSubmissionInBrowser;
extern const base::Feature kAutofillProfileClientValidation; extern const base::Feature kAutofillProfileClientValidation;
extern const base::Feature kAutofillProfileImportFromUnfocusableFields;
extern const base::Feature kAutofillProfileServerValidation; extern const base::Feature kAutofillProfileServerValidation;
extern const base::Feature kAutofillRestrictUnownedFieldsToFormlessCheckout; extern const base::Feature kAutofillRestrictUnownedFieldsToFormlessCheckout;
extern const base::Feature kAutofillRichMetadataQueries; extern const base::Feature kAutofillRichMetadataQueries;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment