Index: components/autofill/core/browser/contact_info_unittest.cc |
diff --git a/components/autofill/core/browser/contact_info_unittest.cc b/components/autofill/core/browser/contact_info_unittest.cc |
index 4c2be9d42e490aa5f1ebe7c57e959e2f12a0604e..ab7c032857f17fb1bd2a881d5fd009329557c181 100644 |
--- a/components/autofill/core/browser/contact_info_unittest.cc |
+++ b/components/autofill/core/browser/contact_info_unittest.cc |
@@ -104,4 +104,21 @@ TEST(NameInfoTest, GetFullName) { |
EXPECT_EQ(name.GetRawInfo(NAME_FULL), ASCIIToUTF16("First Middle Last")); |
} |
+TEST(NameInfoTest, Compare) { |
+ NameInfo a, b; |
+ a.SetRawInfo(NAME_FIRST, ASCIIToUTF16("First")); |
+ a.SetRawInfo(NAME_MIDDLE, ASCIIToUTF16("Middle")); |
+ a.SetRawInfo(NAME_LAST, ASCIIToUTF16("Last")); |
+ |
+ // Result of assignment should be logically equal to the original NameInfo. |
+ b = a; |
+ EXPECT_TRUE(a == b); |
+ |
+ // a{first|middle|last} is not equal to b{first||middle last} |
+ a.SetRawInfo(NAME_FULL, ASCIIToUTF16("First Middle Last")); |
+ b.SetRawInfo(NAME_FIRST, ASCIIToUTF16("First")); |
+ b.SetRawInfo(NAME_MIDDLE, base::string16()); |
+ b.SetRawInfo(NAME_LAST, ASCIIToUTF16("Middle Last")); |
+ EXPECT_TRUE(a != b); |
+} |
} // namespace autofill |