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

Unified Diff: chrome/browser/autofill/autofill_profile_unittest.cc

Issue 5521005: AutoFillProfile: Don't clobber data on self-assignment (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Moar bettar Created 10 years 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 | « chrome/browser/autofill/autofill_profile.cc ('k') | chrome/browser/autofill/credit_card.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autofill/autofill_profile_unittest.cc
diff --git a/chrome/browser/autofill/autofill_profile_unittest.cc b/chrome/browser/autofill/autofill_profile_unittest.cc
index 3c500a3927b24a38f2703d1cd596556c46359082..033fa5705133e2c530b40b0cbd233f230bfdd56a 100644
--- a/chrome/browser/autofill/autofill_profile_unittest.cc
+++ b/chrome/browser/autofill/autofill_profile_unittest.cc
@@ -495,6 +495,22 @@ TEST(AutoFillProfileTest, MergeWith) {
EXPECT_EQ(0, expected_b.Compare(*b));
}
+TEST(AutoFillProfileTest, AssignmentOperator){
+ AutoFillProfile a, b;
+
+ // Result of assignment should be logically equal to the original profile.
+ autofill_test::SetProfileInfo(&a, "Billing", "Marion", "Mitchell", "Morrison",
+ "marion@me.xyz", "Fox", "123 Zoo St.", "unit 5",
+ "Hollywood", "CA", "91601", "US", "12345678910",
+ "01987654321");
+ b = a;
+ EXPECT_TRUE(a == b);
+
+ // Assignment to self should not change the profile value.
+ a = a;
+ EXPECT_TRUE(a == b);
+}
+
TEST(AutoFillProfileTest, Compare) {
AutoFillProfile a, b;
« no previous file with comments | « chrome/browser/autofill/autofill_profile.cc ('k') | chrome/browser/autofill/credit_card.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698