diff options
author | dhollowa@chromium.org <dhollowa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-28 01:58:59 +0000 |
---|---|---|
committer | dhollowa@chromium.org <dhollowa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-28 01:58:59 +0000 |
commit | 0ef117d8958a768f6eece2fbf14d504e228215b5 (patch) | |
tree | 36eab5e49f512bc1351c43f25963d56f621b6271 | |
parent | 34234cd2bd51dee267bce5769b3175cdf195386f (diff) | |
download | chromium_src-0ef117d8958a768f6eece2fbf14d504e228215b5.zip chromium_src-0ef117d8958a768f6eece2fbf14d504e228215b5.tar.gz chromium_src-0ef117d8958a768f6eece2fbf14d504e228215b5.tar.bz2 |
Aggregated profiles that contains same name but different casing are being merged.
Modifies merging logic to treat profile values as case-insensitive for merging purposes.
BUG=80618
TEST=AutofillMergeTest.DataDrivenMergeProfiles:case.in/out
Review URL: http://codereview.chromium.org/6883211
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@83280 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/autofill/form_group.cc | 6 | ||||
-rw-r--r-- | chrome/test/data/autofill/merge/input/case.in | 28 | ||||
-rw-r--r-- | chrome/test/data/autofill/merge/output/case.out | 14 |
3 files changed, 46 insertions, 2 deletions
diff --git a/chrome/browser/autofill/form_group.cc b/chrome/browser/autofill/form_group.cc index 4baa331..1f17f07 100644 --- a/chrome/browser/autofill/form_group.cc +++ b/chrome/browser/autofill/form_group.cc @@ -31,7 +31,8 @@ bool FormGroup::IsSubsetOf(const FormGroup& form_group) const { for (FieldTypeSet::const_iterator iter = types.begin(); iter != types.end(); ++iter) { - if (GetInfo(*iter) != form_group.GetInfo(*iter)) + if (StringToLowerASCII(GetInfo(*iter)) != + StringToLowerASCII(form_group.GetInfo(*iter))) return false; } @@ -53,7 +54,8 @@ bool FormGroup::IntersectionOfTypesHasEqualValues( for (FieldTypeSet::const_iterator iter = intersection.begin(); iter != intersection.end(); ++iter) { - if (GetInfo(*iter) != form_group.GetInfo(*iter)) + if (StringToLowerASCII(GetInfo(*iter)) != + StringToLowerASCII(form_group.GetInfo(*iter))) return false; } diff --git a/chrome/test/data/autofill/merge/input/case.in b/chrome/test/data/autofill/merge/input/case.in new file mode 100644 index 0000000..4f2dcff --- /dev/null +++ b/chrome/test/data/autofill/merge/input/case.in @@ -0,0 +1,28 @@ +--- +NAME_FIRST: John +NAME_MIDDLE: Kilgore +NAME_LAST: Doe +EMAIL_ADDRESS: john.doe@example.com +COMPANY_NAME: TestCo +ADDRESS_HOME_LINE1: 1600 Amphitheatre Parkway +ADDRESS_HOME_LINE2: (Bldg. 1950) +ADDRESS_HOME_CITY: Mountain View +ADDRESS_HOME_STATE: CA +ADDRESS_HOME_ZIP: 94043 +ADDRESS_HOME_COUNTRY: United States +PHONE_HOME_WHOLE_NUMBER: 6505558888 +PHONE_FAX_WHOLE_NUMBER: 6505556789 +--- +NAME_FIRST: john +NAME_MIDDLE: kilgore +NAME_LAST: doe +EMAIL_ADDRESS: john.doe@example.com +COMPANY_NAME: testCo +ADDRESS_HOME_LINE1: 1600 amphitheatre parkway +ADDRESS_HOME_LINE2: (bldg. 1950) +ADDRESS_HOME_CITY: mountain view +ADDRESS_HOME_STATE: ca +ADDRESS_HOME_ZIP: 94043 +ADDRESS_HOME_COUNTRY: united states +PHONE_HOME_WHOLE_NUMBER: 6505558888 +PHONE_FAX_WHOLE_NUMBER: 6505556789 diff --git a/chrome/test/data/autofill/merge/output/case.out b/chrome/test/data/autofill/merge/output/case.out new file mode 100644 index 0000000..8c6fb81 --- /dev/null +++ b/chrome/test/data/autofill/merge/output/case.out @@ -0,0 +1,14 @@ +--- +NAME_FIRST: John +NAME_MIDDLE: Kilgore +NAME_LAST: Doe +EMAIL_ADDRESS: john.doe@example.com +COMPANY_NAME: TestCo +ADDRESS_HOME_LINE1: 1600 Amphitheatre Parkway +ADDRESS_HOME_LINE2: (Bldg. 1950) +ADDRESS_HOME_CITY: Mountain View +ADDRESS_HOME_STATE: CA +ADDRESS_HOME_ZIP: 94043 +ADDRESS_HOME_COUNTRY: United States +PHONE_HOME_WHOLE_NUMBER: 6505558888 +PHONE_FAX_WHOLE_NUMBER: 6505556789 |