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

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

Issue 5364007: Autofill should not allow overwrite of field data when merging profile data (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Whitespace. Created 10 years, 1 month 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') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autofill/personal_data_manager_unittest.cc
diff --git a/chrome/browser/autofill/personal_data_manager_unittest.cc b/chrome/browser/autofill/personal_data_manager_unittest.cc
index 11978df4bc818eb4fc0a5681a5cf88822e551bb4..a4b3099bf69d82614a81354df012b51f50eddb0e 100644
--- a/chrome/browser/autofill/personal_data_manager_unittest.cc
+++ b/chrome/browser/autofill/personal_data_manager_unittest.cc
@@ -750,8 +750,15 @@ TEST_F(PersonalDataManagerTest, AggregateSameProfileWithConflict) {
"Address:", "address", "1600 Pennsylvania Avenue", "text", &field);
form1.fields.push_back(field);
autofill_test::CreateTestFormField(
+ "Address Line 2:", "address2", "Suite A", "text", &field);
+ form1.fields.push_back(field);
+ autofill_test::CreateTestFormField(
"Email:", "email", "theprez@gmail.com", "text", &field);
form1.fields.push_back(field);
+ // Phone gets updated.
+ autofill_test::CreateTestFormField(
+ "Phone:", "phone", "4445556666", "text", &field);
+ form1.fields.push_back(field);
FormStructure form_structure1(form1);
std::vector<FormStructure*> forms;
@@ -766,8 +773,8 @@ TEST_F(PersonalDataManagerTest, AggregateSameProfileWithConflict) {
AutoFillProfile expected;
autofill_test::SetProfileInfo(&expected, NULL, "George", NULL,
- "Washington", "theprez@gmail.com", NULL, "1600 Pennsylvania Avenue", NULL,
- NULL, NULL, NULL, NULL, NULL, NULL);
+ "Washington", "theprez@gmail.com", NULL, "1600 Pennsylvania Avenue",
+ "Suite A", NULL, NULL, NULL, NULL, "4445556666", NULL);
const std::vector<AutoFillProfile*>& results1 = personal_data_->profiles();
ASSERT_EQ(1U, results1.size());
EXPECT_EQ(0, expected.Compare(*results1[0]));
@@ -783,13 +790,19 @@ TEST_F(PersonalDataManagerTest, AggregateSameProfileWithConflict) {
autofill_test::CreateTestFormField(
"Address:", "address", "1600 Pennsylvania Avenue", "text", &field);
form2.fields.push_back(field);
+ autofill_test::CreateTestFormField(
+ "Address Line 2:", "address2", "Suite A", "text", &field);
+ form2.fields.push_back(field);
+ autofill_test::CreateTestFormField(
+ "Email:", "email", "theprez@gmail.com", "text", &field);
+ form2.fields.push_back(field);
// Country gets added.
autofill_test::CreateTestFormField(
"Country:", "country", "USA", "text", &field);
form2.fields.push_back(field);
- // Email gets updated.
+ // Phone gets updated.
autofill_test::CreateTestFormField(
- "Email:", "email", "new_email@gmail.com", "text", &field);
+ "Phone:", "phone", "1231231234", "text", &field);
form2.fields.push_back(field);
FormStructure form_structure2(form2);
@@ -807,8 +820,8 @@ TEST_F(PersonalDataManagerTest, AggregateSameProfileWithConflict) {
AutoFillProfile expected2;
autofill_test::SetProfileInfo(&expected2, NULL, "George", NULL,
- "Washington", "new_email@gmail.com", NULL, "1600 Pennsylvania Avenue",
- NULL, NULL, NULL, NULL, "USA", NULL, NULL);
+ "Washington", "theprez@gmail.com", NULL, "1600 Pennsylvania Avenue",
+ "Suite A", NULL, NULL, NULL, "USA", "1231231234", NULL);
ASSERT_EQ(1U, results2.size());
EXPECT_EQ(0, expected2.Compare(*results2[0]));
}
« no previous file with comments | « chrome/browser/autofill/autofill_profile.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698