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

Unified Diff: chrome/browser/autofill/credit_card_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/credit_card.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autofill/credit_card_unittest.cc
diff --git a/chrome/browser/autofill/credit_card_unittest.cc b/chrome/browser/autofill/credit_card_unittest.cc
index 507379baebce8db6a95b928445ed8f6cffdb172c..89e73d7d0fa27f891b7f70ac2853609c9333f8b8 100644
--- a/chrome/browser/autofill/credit_card_unittest.cc
+++ b/chrome/browser/autofill/credit_card_unittest.cc
@@ -67,5 +67,19 @@ TEST(CreditCardTest, PreviewSummaryAndObfuscatedNumberStrings) {
EXPECT_EQ(string16(ASCIIToUTF16("************9012")), obfuscated4);
}
+TEST(CreditCardTest, AssignmentOperator){
+ CreditCard a, b;
+
+ // Result of assignment should be logically equal to the original profile.
+ autofill_test::SetCreditCardInfo(&a, "Corporate", "John Dillinger",
+ "123456789012", "01", "2010");
+ b = a;
+ EXPECT_TRUE(a == b);
+
+ // Assignment to self should not change the profile value.
+ a = a;
+ EXPECT_TRUE(a == b);
+}
+
} // namespace
« no previous file with comments | « chrome/browser/autofill/credit_card.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698