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

Unified Diff: components/autofill/core/browser/autofill_profile_comparator_unittest.cc

Issue 2137533002: Embed address normalization rewriting rules. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/autofill/core/browser/autofill_profile_comparator.cc ('k') | components/components_tests.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/autofill/core/browser/autofill_profile_comparator_unittest.cc
diff --git a/components/autofill/core/browser/autofill_profile_comparator_unittest.cc b/components/autofill/core/browser/autofill_profile_comparator_unittest.cc
index a4473fb62ac33a33f4d24252cc0a61a785bec831..ff4727f0fe15f9a4d5aad83a74f877aa1ae36b07 100644
--- a/components/autofill/core/browser/autofill_profile_comparator_unittest.cc
+++ b/components/autofill/core/browser/autofill_profile_comparator_unittest.cc
@@ -840,3 +840,22 @@ TEST_F(AutofillProfileComparatorTest, MergeAddresses) {
MergeAddressesAndExpect(p1, p2, expected);
}
+
+TEST_F(AutofillProfileComparatorTest, MergeAddressesWithRewrite) {
+ AutofillProfile empty;
+ AutofillProfile p1 = CreateProfileWithAddress(
+ "6543 CH BACON", "APP 3", "MONTRÉAL", "QUÉBEC", "HHH999", "ca");
+ AutofillProfile p2 = CreateProfileWithAddress(
+ "6543, Bacon Rd", "", "Montreal", "QC", "hhh 999", "CA");
+ p2.set_use_date(p1.use_date() + base::TimeDelta::FromMinutes(1));
+
+ Address expected;
+ expected.SetRawInfo(ADDRESS_HOME_LINE1, UTF8ToUTF16("6543 CH BACON"));
+ expected.SetRawInfo(ADDRESS_HOME_LINE2, UTF8ToUTF16("APP 3"));
+ expected.SetRawInfo(ADDRESS_HOME_CITY, UTF8ToUTF16("Montreal"));
+ expected.SetRawInfo(ADDRESS_HOME_STATE, UTF8ToUTF16("QC"));
+ expected.SetRawInfo(ADDRESS_HOME_ZIP, UTF8ToUTF16("hhh 999"));
+ expected.SetRawInfo(ADDRESS_HOME_COUNTRY, UTF8ToUTF16("CA"));
+
+ MergeAddressesAndExpect(p1, p2, expected);
+}
« no previous file with comments | « components/autofill/core/browser/autofill_profile_comparator.cc ('k') | components/components_tests.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698