diff options
author | isherman@chromium.org <isherman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-07 05:57:34 +0000 |
---|---|---|
committer | isherman@chromium.org <isherman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-07 05:57:34 +0000 |
commit | 1ea7f9f632c1d5e523a066d37dffb55f617f621b (patch) | |
tree | 5835c9207222dccefda34392c6236863a6849f6a /chrome/browser/autofill/autofill_profile_unittest.cc | |
parent | 19fe26da9f6361e4f686817ed4881969cdc3f9ac (diff) | |
download | chromium_src-1ea7f9f632c1d5e523a066d37dffb55f617f621b.zip chromium_src-1ea7f9f632c1d5e523a066d37dffb55f617f621b.tar.gz chromium_src-1ea7f9f632c1d5e523a066d37dffb55f617f621b.tar.bz2 |
AutoFillProfile: Don't clobber data on self-assignment
BUG=none
TEST=unit_test --gtest_filter=AutoFillProfileTest.AssignmentOperator:CreditCardTest.AssignmentOperator
Review URL: http://codereview.chromium.org/5521005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@68449 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/autofill/autofill_profile_unittest.cc')
-rw-r--r-- | chrome/browser/autofill/autofill_profile_unittest.cc | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/chrome/browser/autofill/autofill_profile_unittest.cc b/chrome/browser/autofill/autofill_profile_unittest.cc index 3c500a3..033fa57 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; |