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

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

Issue 332213004: Fix profile comparison re: address lines. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: change test Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/autofill/core/browser/autofill_profile.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/autofill/core/browser/autofill_profile_unittest.cc
diff --git a/components/autofill/core/browser/autofill_profile_unittest.cc b/components/autofill/core/browser/autofill_profile_unittest.cc
index de550bd827bd869c9966a9a650fba85111e746db..01046a461eb277cf4ff9123137fe9931be1b0e21 100644
--- a/components/autofill/core/browser/autofill_profile_unittest.cc
+++ b/components/autofill/core/browser/autofill_profile_unittest.cc
@@ -654,6 +654,18 @@ TEST(AutofillProfileTest, Compare) {
NULL, NULL, NULL, NULL, NULL, NULL, NULL, "408.555.4321");
EXPECT_GT(0, a.Compare(b));
EXPECT_LT(0, b.Compare(a));
+
+ // Addresses are compared in full. Regression test for http://crbug.com/375545
+ test::SetProfileInfo(&a, "John", NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+ a.SetRawInfo(ADDRESS_HOME_STREET_ADDRESS,
+ ASCIIToUTF16("line one\nline two"));
+ test::SetProfileInfo(&b, "John", NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+ b.SetRawInfo(ADDRESS_HOME_STREET_ADDRESS,
+ ASCIIToUTF16("line one\nline two\nline three"));
+ EXPECT_GT(0, a.Compare(b));
+ EXPECT_LT(0, b.Compare(a));
}
TEST(AutofillProfileTest, MultiValueNames) {
« no previous file with comments | « components/autofill/core/browser/autofill_profile.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698