summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorsiggi@chromium.org <siggi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-13 15:23:33 +0000
committersiggi@chromium.org <siggi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-13 15:23:33 +0000
commitc957e55d6e50832328231fa86267f9e5a4b91a3b (patch)
tree2e1320be523be4ee5f709ff097001695e1420d86 /chrome
parent0a8db0d25b730ea77c96733b53f39abd55305ae7 (diff)
downloadchromium_src-c957e55d6e50832328231fa86267f9e5a4b91a3b.zip
chromium_src-c957e55d6e50832328231fa86267f9e5a4b91a3b.tar.gz
chromium_src-c957e55d6e50832328231fa86267f9e5a4b91a3b.tar.bz2
Looks to have broken unittest, see http://chromegw.corp.google.com/i/chromium/builders/Vista%20Tests%20%28dbg%29%281%29/builds/8263/steps/unit_tests/logs/TestLongSafePureFilename
Revert 81416 - Autofill extend profiles to include multi-valued fields, part 6 (Aggregation)Extends the Autofill aggregation logic to merge profiles with a common address into a single profile with multi-valued fields. Also, extends the web_database migration to include this new logic when migrating the web_database preferences.BUG=65625TEST=WebDatabaseMigrationTest.MigrateVersion32ToCurrent:AutofillMergeTest.DataDrivenMergeProfiles:AutofillProfileTest.*Review URL: http://codereview.chromium.org/6826059 TBR=dhollowa@chromium.org Review URL: http://codereview.chromium.org/6833026 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@81421 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/autofill/autofill_merge_unittest.cc24
-rw-r--r--chrome/browser/autofill/autofill_profile.cc85
-rw-r--r--chrome/browser/autofill/autofill_profile.h7
-rw-r--r--chrome/browser/autofill/personal_data_manager.cc20
-rw-r--r--chrome/browser/autofill/personal_data_manager_unittest.cc116
-rw-r--r--chrome/browser/webdata/autofill_table.cc2
-rw-r--r--chrome/browser/webdata/autofill_table.h2
-rw-r--r--chrome/browser/webdata/web_database.cc18
-rw-r--r--chrome/browser/webdata/web_database_migration_unittest.cc36
-rw-r--r--chrome/test/data/autofill/merge/input/ambiguous.in21
-rw-r--r--chrome/test/data/autofill/merge/input/identical.in8
-rw-r--r--chrome/test/data/autofill/merge/input/multimerge.in28
-rw-r--r--chrome/test/data/autofill/merge/input/singlemerge.in28
-rw-r--r--chrome/test/data/autofill/merge/input/validation.in20
-rw-r--r--chrome/test/data/autofill/merge/output/ambiguous.out0
-rw-r--r--chrome/test/data/autofill/merge/output/identical.out4
-rw-r--r--chrome/test/data/autofill/merge/output/multimerge.out19
-rw-r--r--chrome/test/data/autofill/merge/output/singlemerge.out14
-rw-r--r--chrome/test/data/autofill/merge/output/validation.out4
19 files changed, 76 insertions, 380 deletions
diff --git a/chrome/browser/autofill/autofill_merge_unittest.cc b/chrome/browser/autofill/autofill_merge_unittest.cc
index 64ee661..cbd83d3 100644
--- a/chrome/browser/autofill/autofill_merge_unittest.cc
+++ b/chrome/browser/autofill/autofill_merge_unittest.cc
@@ -39,8 +39,8 @@ const AutofillFieldType kProfileFieldTypes[] = {
ADDRESS_HOME_STATE,
ADDRESS_HOME_ZIP,
ADDRESS_HOME_COUNTRY,
- PHONE_HOME_WHOLE_NUMBER,
- PHONE_FAX_WHOLE_NUMBER,
+ PHONE_HOME_NUMBER,
+ PHONE_FAX_NUMBER,
};
// Serializes the |profiles| into a string.
@@ -51,14 +51,10 @@ std::string SerializeProfiles(const std::vector<AutofillProfile*>& profiles) {
result += "\n";
for (size_t j = 0; j < arraysize(kProfileFieldTypes); ++j) {
AutofillFieldType type = kProfileFieldTypes[j];
- std::vector<string16> values;
- profiles[i]->GetMultiInfo(type, &values);
- for (size_t k = 0; k < values.size(); ++k) {
- result += AutofillType::FieldTypeToString(type);
- result += kFieldSeparator;
- result += UTF16ToUTF8(values[k]);
- result += "\n";
- }
+ result += AutofillType::FieldTypeToString(type);
+ result += kFieldSeparator;
+ result += UTF16ToUTF8(profiles[i]->GetInfo(type));
+ result += "\n";
}
}
@@ -148,6 +144,11 @@ void AutofillMergeTest::SetUp() {
void AutofillMergeTest::GenerateResults(const std::string& input,
std::string* output) {
MergeProfiles(input, output);
+
+ // Verify that the test is idempotent on the output profiles.
+ std::string merged_output;
+ MergeProfiles(*output, &merged_output);
+ EXPECT_EQ(*output, merged_output);
}
void AutofillMergeTest::MergeProfiles(const std::string& profiles,
@@ -187,7 +188,8 @@ void AutofillMergeTest::MergeProfiles(const std::string& profiles,
// The first line is always a profile separator, and the last profile is not
// followed by an explicit separator.
- if ((i > 0 && line == kProfileSeparator) || i == lines.size() - 1) {
+ if ((i > 0 && line == kProfileSeparator) ||
+ i == lines.size() - 1) {
// Reached the end of a profile. Try to import it.
FormStructure form_structure(form);
for (size_t i = 0; i < form_structure.field_count(); ++i) {
diff --git a/chrome/browser/autofill/autofill_profile.cc b/chrome/browser/autofill/autofill_profile.cc
index d21c712..7a526cc 100644
--- a/chrome/browser/autofill/autofill_profile.cc
+++ b/chrome/browser/autofill/autofill_profile.cc
@@ -4,7 +4,6 @@
#include "chrome/browser/autofill/autofill_profile.h"
-#include <algorithm>
#include <map>
#include <set>
@@ -135,45 +134,6 @@ void CopyItemsToValues(AutofillFieldType type,
(*values)[i] = form_group_items[i].GetInfo(type);
}
-// Collapse compound field types to their "full" type. I.e. First name
-// collapses to full name, area code collapses to full phone, etc.
-void CollapseCompoundFieldTypes(FieldTypeSet* type_set) {
- FieldTypeSet collapsed_set;
- for (FieldTypeSet::iterator iter = type_set->begin(); iter != type_set->end();
- ++iter) {
- switch (*iter) {
- case NAME_FIRST:
- case NAME_MIDDLE:
- case NAME_LAST:
- case NAME_MIDDLE_INITIAL:
- case NAME_FULL:
- case NAME_SUFFIX:
- collapsed_set.insert(NAME_FULL);
- break;
-
- case PHONE_HOME_NUMBER:
- case PHONE_HOME_CITY_CODE:
- case PHONE_HOME_COUNTRY_CODE:
- case PHONE_HOME_CITY_AND_NUMBER:
- case PHONE_HOME_WHOLE_NUMBER:
- collapsed_set.insert(PHONE_HOME_WHOLE_NUMBER);
- break;
-
- case PHONE_FAX_NUMBER:
- case PHONE_FAX_CITY_CODE:
- case PHONE_FAX_COUNTRY_CODE:
- case PHONE_FAX_CITY_AND_NUMBER:
- case PHONE_FAX_WHOLE_NUMBER:
- collapsed_set.insert(PHONE_FAX_WHOLE_NUMBER);
- break;
-
- default:
- collapsed_set.insert(*iter);
- }
- }
- std::swap(*type_set, collapsed_set);
-}
-
} // namespace
AutofillProfile::AutofillProfile(const std::string& guid)
@@ -292,15 +252,6 @@ void AutofillProfile::GetMultiInfo(AutofillFieldType type,
}
}
-// static
-bool AutofillProfile::SupportsMultiValue(AutofillFieldType type) {
- AutofillType::FieldTypeGroup group = AutofillType(type).group();
- return group == AutofillType::NAME ||
- group == AutofillType::EMAIL ||
- group == AutofillType::PHONE_HOME ||
- group == AutofillType::PHONE_FAX;
-}
-
const string16 AutofillProfile::Label() const {
return label_;
}
@@ -460,38 +411,10 @@ bool AutofillProfile::operator!=(const AutofillProfile& profile) const {
}
const string16 AutofillProfile::PrimaryValue() const {
- return GetInfo(ADDRESS_HOME_LINE1) +
- GetInfo(ADDRESS_HOME_CITY);
-}
-
-void AutofillProfile::OverwriteWithOrAddTo(const AutofillProfile& profile) {
- FieldTypeSet field_types;
- profile.GetAvailableFieldTypes(&field_types);
-
- // Only transfer "full" types (e.g. full name) and not fragments (e.g.
- // first name, last name).
- CollapseCompoundFieldTypes(&field_types);
-
- for (FieldTypeSet::const_iterator iter = field_types.begin();
- iter != field_types.end(); ++iter) {
- if (AutofillProfile::SupportsMultiValue(*iter)) {
- std::vector<string16> new_values;
- profile.GetMultiInfo(*iter, &new_values);
- std::vector<string16> existing_values;
- GetMultiInfo(*iter, &existing_values);
- for (std::vector<string16>::iterator value_iter = new_values.begin();
- value_iter != new_values.end(); ++value_iter) {
- // Don't add duplicates.
- if (std::find(existing_values.begin(), existing_values.end(),
- *value_iter) == existing_values.end()) {
- existing_values.insert(existing_values.end(), *value_iter);
- }
- }
- SetMultiInfo(*iter, existing_values);
- } else {
- SetInfo(*iter, profile.GetInfo(*iter));
- }
- }
+ return GetInfo(NAME_FULL) +
+ GetInfo(ADDRESS_HOME_LINE1) +
+ GetInfo(ADDRESS_HOME_LINE2) +
+ GetInfo(EMAIL_ADDRESS);
}
string16 AutofillProfile::ConstructInferredLabel(
diff --git a/chrome/browser/autofill/autofill_profile.h b/chrome/browser/autofill/autofill_profile.h
index 4610482..ea301b7 100644
--- a/chrome/browser/autofill/autofill_profile.h
+++ b/chrome/browser/autofill/autofill_profile.h
@@ -49,9 +49,6 @@ class AutofillProfile : public FormGroup {
void GetMultiInfo(AutofillFieldType type,
std::vector<string16>* values) const;
- // Returns |true| if |type| accepts multi-values.
- static bool SupportsMultiValue(AutofillFieldType type);
-
// The user-visible label of the profile, generated in relation to other
// profiles. Shows at least 2 fields that differentiate profile from other
// profiles. See AdjustInferredLabels() further down for more description.
@@ -119,10 +116,6 @@ class AutofillProfile : public FormGroup {
// aid with correct aggregation of new data.
const string16 PrimaryValue() const;
- // Overwrites the single-valued field data in |profile| with this
- // Profile. Or, for multi-valued fields append the new values.
- void OverwriteWithOrAddTo(const AutofillProfile& profile);
-
private:
typedef std::vector<const FormGroup*> FormGroupList;
diff --git a/chrome/browser/autofill/personal_data_manager.cc b/chrome/browser/autofill/personal_data_manager.cc
index 184b7a9..46fee8a3 100644
--- a/chrome/browser/autofill/personal_data_manager.cc
+++ b/chrome/browser/autofill/personal_data_manager.cc
@@ -195,10 +195,6 @@ bool PersonalDataManager::ImportFormData(
// possible to import.
int importable_credit_card_fields = 0;
std::vector<const FormStructure*>::const_iterator iter;
-
- // Detect and discard forms with multiple fields of the same type.
- std::set<AutofillFieldType> types_seen;
-
for (iter = form_structures.begin(); iter != form_structures.end(); ++iter) {
const FormStructure* form = *iter;
for (size_t i = 0; i < form->field_count(); ++i) {
@@ -213,20 +209,6 @@ bool PersonalDataManager::ImportFormData(
AutofillFieldType field_type = field->type();
FieldTypeGroup group(AutofillType(field_type).group());
- // Abandon the import if two fields of the same type are encountered.
- // This indicates ambiguous data or miscategorization of types.
- // Make an exception for PHONE_HOME_NUMBER however as both prefix and
- // suffix are stored against this type.
- if (types_seen.count(field_type) &&
- field_type != PHONE_HOME_NUMBER &&
- field_type != PHONE_FAX_NUMBER) {
- imported_profile.reset();
- local_imported_credit_card.reset();
- break;
- } else {
- types_seen.insert(field_type);
- }
-
if (group == AutofillType::CREDIT_CARD) {
// If the user has a password set, we have no way of setting credit
// card numbers.
@@ -731,7 +713,7 @@ bool PersonalDataManager::MergeProfile(
if (!profile.PrimaryValue().empty() &&
(*iter)->PrimaryValue() == profile.PrimaryValue()) {
merged = true;
- (*iter)->OverwriteWithOrAddTo(profile);
+ (*iter)->OverwriteWith(profile);
}
}
merged_profiles->push_back(**iter);
diff --git a/chrome/browser/autofill/personal_data_manager_unittest.cc b/chrome/browser/autofill/personal_data_manager_unittest.cc
index 4c031b6..fa71c22 100644
--- a/chrome/browser/autofill/personal_data_manager_unittest.cc
+++ b/chrome/browser/autofill/personal_data_manager_unittest.cc
@@ -808,7 +808,7 @@ TEST_F(PersonalDataManagerTest, AggregateTwoDifferentProfiles) {
"Email:", "email", "second@gmail.com", "text", &field);
form2.fields.push_back(field);
autofill_test::CreateTestFormField(
- "Address:", "address1", "22 Laussat St", "text", &field);
+ "Address:", "address1", "21 Laussat St", "text", &field);
form2.fields.push_back(field);
autofill_test::CreateTestFormField(
"City:", "city", "San Francisco", "text", &field);
@@ -837,112 +837,13 @@ TEST_F(PersonalDataManagerTest, AggregateTwoDifferentProfiles) {
AutofillProfile expected2;
autofill_test::SetProfileInfo(&expected2, "John", NULL,
- "Adams", "second@gmail.com", NULL, "22 Laussat St", NULL,
+ "Adams", "second@gmail.com", NULL, "21 Laussat St", NULL,
"San Francisco", "California", "94102", NULL, NULL, NULL);
ASSERT_EQ(2U, results2.size());
EXPECT_EQ(0, expected.Compare(*results2[0]));
EXPECT_EQ(0, expected2.Compare(*results2[1]));
}
-TEST_F(PersonalDataManagerTest, AggregateTwoProfilesWithMultiValue) {
- FormData form1;
- webkit_glue::FormField field;
- autofill_test::CreateTestFormField(
- "First name:", "first_name", "George", "text", &field);
- form1.fields.push_back(field);
- autofill_test::CreateTestFormField(
- "Last name:", "last_name", "Washington", "text", &field);
- form1.fields.push_back(field);
- autofill_test::CreateTestFormField(
- "Email:", "email", "theprez@gmail.com", "text", &field);
- form1.fields.push_back(field);
- autofill_test::CreateTestFormField(
- "Address:", "address1", "21 Laussat St", "text", &field);
- form1.fields.push_back(field);
- autofill_test::CreateTestFormField(
- "City:", "city", "San Francisco", "text", &field);
- form1.fields.push_back(field);
- autofill_test::CreateTestFormField(
- "State:", "state", "California", "text", &field);
- form1.fields.push_back(field);
- autofill_test::CreateTestFormField(
- "Zip:", "zip", "94102", "text", &field);
- form1.fields.push_back(field);
-
- FormStructure form_structure1(form1);
- form_structure1.DetermineHeuristicTypes();
- std::vector<const FormStructure*> forms;
- forms.push_back(&form_structure1);
- const CreditCard* imported_credit_card;
- EXPECT_TRUE(personal_data_->ImportFormData(forms, &imported_credit_card));
- ASSERT_FALSE(imported_credit_card);
-
- // Wait for the refresh.
- EXPECT_CALL(personal_data_observer_,
- OnPersonalDataLoaded()).WillOnce(QuitUIMessageLoop());
-
- MessageLoop::current()->Run();
-
- AutofillProfile expected;
- autofill_test::SetProfileInfo(&expected, "George", NULL,
- "Washington", "theprez@gmail.com", NULL, "21 Laussat St", NULL,
- "San Francisco", "California", "94102", NULL, NULL, NULL);
- const std::vector<AutofillProfile*>& results1 = personal_data_->profiles();
- ASSERT_EQ(1U, results1.size());
- EXPECT_EQ(0, expected.Compare(*results1[0]));
-
- // Now create a completely different profile.
- FormData form2;
- autofill_test::CreateTestFormField(
- "First name:", "first_name", "John", "text", &field);
- form2.fields.push_back(field);
- autofill_test::CreateTestFormField(
- "Last name:", "last_name", "Adams", "text", &field);
- form2.fields.push_back(field);
- autofill_test::CreateTestFormField(
- "Email:", "email", "second@gmail.com", "text", &field);
- form2.fields.push_back(field);
- autofill_test::CreateTestFormField(
- "Address:", "address1", "21 Laussat St", "text", &field);
- form2.fields.push_back(field);
- autofill_test::CreateTestFormField(
- "City:", "city", "San Francisco", "text", &field);
- form2.fields.push_back(field);
- autofill_test::CreateTestFormField(
- "State:", "state", "California", "text", &field);
- form2.fields.push_back(field);
- autofill_test::CreateTestFormField(
- "Zip:", "zip", "94102", "text", &field);
- form2.fields.push_back(field);
-
- FormStructure form_structure2(form2);
- form_structure2.DetermineHeuristicTypes();
- forms.clear();
- forms.push_back(&form_structure2);
- EXPECT_TRUE(personal_data_->ImportFormData(forms, &imported_credit_card));
- ASSERT_FALSE(imported_credit_card);
-
- // Wait for the refresh.
- EXPECT_CALL(personal_data_observer_,
- OnPersonalDataLoaded()).WillOnce(QuitUIMessageLoop());
-
- MessageLoop::current()->Run();
-
- const std::vector<AutofillProfile*>& results2 = personal_data_->profiles();
-
- // Modify expected to include multi-valued fields.
- std::vector<string16> values;
- expected.GetMultiInfo(NAME_FULL, &values);
- values.push_back(ASCIIToUTF16("John Adams"));
- expected.SetMultiInfo(NAME_FULL, values);
- expected.GetMultiInfo(EMAIL_ADDRESS, &values);
- values.push_back(ASCIIToUTF16("second@gmail.com"));
- expected.SetMultiInfo(EMAIL_ADDRESS, values);
-
- ASSERT_EQ(1U, results2.size());
- EXPECT_EQ(0, expected.CompareMulti(*results2[0]));
-}
-
TEST_F(PersonalDataManagerTest, AggregateSameProfileWithConflict) {
FormData form1;
webkit_glue::FormField field;
@@ -1048,14 +949,13 @@ TEST_F(PersonalDataManagerTest, AggregateSameProfileWithConflict) {
const std::vector<AutofillProfile*>& results2 = personal_data_->profiles();
- // Add multi-valued phone number to expectation. Also, country gets added.
- std::vector<string16> values;
- expected.GetMultiInfo(PHONE_HOME_WHOLE_NUMBER, &values);
- values.push_back(ASCIIToUTF16("1231231234"));
- expected.SetMultiInfo(PHONE_HOME_WHOLE_NUMBER, values);
- expected.SetInfo(ADDRESS_HOME_COUNTRY, ASCIIToUTF16("United States"));
+ AutofillProfile expected2;
+ autofill_test::SetProfileInfo(&expected2, "George", NULL,
+ "Washington", "theprez@gmail.com", NULL, "1600 Pennsylvania Avenue",
+ "Suite A", "San Francisco", "California", "94102", "USA", "1231231234",
+ NULL);
ASSERT_EQ(1U, results2.size());
- EXPECT_EQ(0, expected.CompareMulti(*results2[0]));
+ EXPECT_EQ(0, expected2.Compare(*results2[0]));
}
TEST_F(PersonalDataManagerTest, AggregateProfileWithMissingInfoInOld) {
diff --git a/chrome/browser/webdata/autofill_table.cc b/chrome/browser/webdata/autofill_table.cc
index 3a64c704..aca25f3 100644
--- a/chrome/browser/webdata/autofill_table.cc
+++ b/chrome/browser/webdata/autofill_table.cc
@@ -2051,7 +2051,7 @@ bool AutofillTable::MigrateToVersion35GreatBritainCountryCodes() {
}
// Merge and cull older profiles where possible.
-bool AutofillTable::MigrateToVersion37MergeAndCullOlderProfiles() {
+bool AutofillTable::MigrateToVersion36MergeAndCullOlderProfiles() {
sql::Statement s(db_->GetUniqueStatement(
"SELECT guid, date_modified FROM autofill_profiles"));
if (!s)
diff --git a/chrome/browser/webdata/autofill_table.h b/chrome/browser/webdata/autofill_table.h
index 38744e0..d86eb1c 100644
--- a/chrome/browser/webdata/autofill_table.h
+++ b/chrome/browser/webdata/autofill_table.h
@@ -269,7 +269,7 @@ class AutofillTable : public WebDatabaseTable {
bool MigrateToVersion33ProfilesBasedOnFirstName();
bool MigrateToVersion34ProfilesBasedOnCountryCode();
bool MigrateToVersion35GreatBritainCountryCodes();
- bool MigrateToVersion37MergeAndCullOlderProfiles();
+ bool MigrateToVersion36MergeAndCullOlderProfiles();
private:
FRIEND_TEST_ALL_PREFIXES(AutofillTableTest, Autofill);
diff --git a/chrome/browser/webdata/web_database.cc b/chrome/browser/webdata/web_database.cc
index 45a06a8..6169be3 100644
--- a/chrome/browser/webdata/web_database.cc
+++ b/chrome/browser/webdata/web_database.cc
@@ -16,8 +16,8 @@ namespace {
// Current version number. Note: when changing the current version number,
// corresponding changes must happen in the unit tests, and new migration test
// added. See |WebDatabaseMigrationTest::kCurrentTestedVersionNumber|.
-const int kCurrentVersionNumber = 37;
-const int kCompatibleVersionNumber = 37;
+const int kCurrentVersionNumber = 36;
+const int kCompatibleVersionNumber = 36;
// Change the version number and possibly the compatibility version of
// |meta_table_|.
@@ -264,19 +264,11 @@ sql::InitStatus WebDatabase::MigrateOldVersionsAsNeeded() {
ChangeVersion(&meta_table_, 35, true);
// FALL THROUGH
- // Combine migrations 35 and 36. This is due to enhancements to the merge
- // step when migrating profiles. The original migration from 35 to 36 did
- // not merge profiles with identical addresses, but the migration from 36 to
- // 37 does. The step from 35 to 36 should only happen on the Chrome 12 dev
- // channel. Chrome 12 beta and release users will jump from 35 to 37
- // directly getting the full benefits of the multi-valued merge as well as
- // the culling of bad data.
case 35:
- case 36:
- if (!autofill_table_->MigrateToVersion37MergeAndCullOlderProfiles())
- return FailedMigrationTo(37);
+ if (!autofill_table_->MigrateToVersion36MergeAndCullOlderProfiles())
+ return FailedMigrationTo(36);
- ChangeVersion(&meta_table_, 37, true);
+ ChangeVersion(&meta_table_, 36, true);
// FALL THROUGH
// Add successive versions here. Each should set the version number and
diff --git a/chrome/browser/webdata/web_database_migration_unittest.cc b/chrome/browser/webdata/web_database_migration_unittest.cc
index c27abb9..0d2a365 100644
--- a/chrome/browser/webdata/web_database_migration_unittest.cc
+++ b/chrome/browser/webdata/web_database_migration_unittest.cc
@@ -212,7 +212,7 @@ class WebDatabaseMigrationTest : public testing::Test {
DISALLOW_COPY_AND_ASSIGN(WebDatabaseMigrationTest);
};
-const int WebDatabaseMigrationTest::kCurrentTestedVersionNumber = 37;
+const int WebDatabaseMigrationTest::kCurrentTestedVersionNumber = 36;
void WebDatabaseMigrationTest::LoadDatabase(const FilePath::StringType& file) {
std::string contents;
@@ -1055,7 +1055,16 @@ TEST_F(WebDatabaseMigrationTest, MigrateVersion32ToCurrent) {
EXPECT_EQ(1297882100L, s1.ColumnInt64(8));
// John P. Doe.
- // Gets merged during migration from 35 to 37 due to multi-valued fields.
+ ASSERT_TRUE(s1.Step());
+ EXPECT_EQ("589636FD-9037-3053-200C-80ABC97D7344", s1.ColumnString(0));
+ EXPECT_EQ(ASCIIToUTF16("Doe Enterprises"), s1.ColumnString16(1));
+ EXPECT_EQ(ASCIIToUTF16("1 Main St"), s1.ColumnString16(2));
+ EXPECT_EQ(ASCIIToUTF16("Apt 1"), s1.ColumnString16(3));
+ EXPECT_EQ(ASCIIToUTF16("Los Altos"), s1.ColumnString16(4));
+ EXPECT_EQ(ASCIIToUTF16("CA"), s1.ColumnString16(5));
+ EXPECT_EQ(ASCIIToUTF16("94022"), s1.ColumnString16(6));
+ EXPECT_EQ(ASCIIToUTF16("United States"), s1.ColumnString16(7));
+ EXPECT_EQ(1297882100L, s1.ColumnInt64(8));
// Dave Smith.
ASSERT_TRUE(s1.Step());
@@ -1111,10 +1120,9 @@ TEST_F(WebDatabaseMigrationTest, MigrateVersion32ToCurrent) {
EXPECT_EQ(ASCIIToUTF16(""), s2.ColumnString16(2));
EXPECT_EQ(ASCIIToUTF16("Doe"), s2.ColumnString16(3));
- // John P. Doe. Note same guid as above due to merging of multi-valued
- // fields.
+ // John P. Doe.
ASSERT_TRUE(s2.Step());
- EXPECT_EQ("00580526-FF81-EE2A-0546-1AC593A32E2F", s2.ColumnString(0));
+ EXPECT_EQ("589636FD-9037-3053-200C-80ABC97D7344", s2.ColumnString(0));
EXPECT_EQ(ASCIIToUTF16("John"), s2.ColumnString16(1));
EXPECT_EQ(ASCIIToUTF16("P."), s2.ColumnString16(2));
EXPECT_EQ(ASCIIToUTF16("Doe"), s2.ColumnString16(3));
@@ -1157,8 +1165,9 @@ TEST_F(WebDatabaseMigrationTest, MigrateVersion32ToCurrent) {
EXPECT_EQ(ASCIIToUTF16("john@doe.com"), s3.ColumnString16(1));
// John P. Doe.
- // Gets culled during migration from 35 to 37 due to merging of John Doe and
- // John P. Doe addresses.
+ ASSERT_TRUE(s3.Step());
+ EXPECT_EQ("589636FD-9037-3053-200C-80ABC97D7344", s3.ColumnString(0));
+ EXPECT_EQ(ASCIIToUTF16("john@doe.com"), s3.ColumnString16(1));
// 2 Main Street.
ASSERT_TRUE(s3.Step());
@@ -1199,12 +1208,16 @@ TEST_F(WebDatabaseMigrationTest, MigrateVersion32ToCurrent) {
EXPECT_EQ(ASCIIToUTF16("4153334444"), s4.ColumnString16(2));
// John P. Doe phone.
- // Gets culled during migration from 35 to 37 due to merging of John Doe and
- // John P. Doe addresses.
+ ASSERT_TRUE(s4.Step());
+ EXPECT_EQ("589636FD-9037-3053-200C-80ABC97D7344", s4.ColumnString(0));
+ EXPECT_EQ(0, s4.ColumnInt(1)); // 0 means phone.
+ EXPECT_EQ(ASCIIToUTF16("4151112222"), s4.ColumnString16(2));
// John P. Doe fax.
- // Gets culled during migration from 35 to 37 due to merging of John Doe and
- // John P. Doe addresses.
+ ASSERT_TRUE(s4.Step());
+ EXPECT_EQ("589636FD-9037-3053-200C-80ABC97D7344", s4.ColumnString(0));
+ EXPECT_EQ(1, s4.ColumnInt(1)); // 1 means fax.
+ EXPECT_EQ(ASCIIToUTF16("4153334444"), s4.ColumnString16(2));
// 2 Main Street phone.
ASSERT_TRUE(s4.Step());
@@ -1244,6 +1257,7 @@ TEST_F(WebDatabaseMigrationTest, MigrateVersion32ToCurrent) {
EXPECT_EQ(1, s4.ColumnInt(1)); // 1 means fax.
EXPECT_EQ(ASCIIToUTF16(""), s4.ColumnString16(2));
+
// Should be all.
EXPECT_FALSE(s4.Step());
}
diff --git a/chrome/test/data/autofill/merge/input/ambiguous.in b/chrome/test/data/autofill/merge/input/ambiguous.in
deleted file mode 100644
index afd96443..0000000
--- a/chrome/test/data/autofill/merge/input/ambiguous.in
+++ /dev/null
@@ -1,21 +0,0 @@
----
-NAME_FIRST: John
-NAME_FIRST: James
-NAME_MIDDLE: Kilgore
-NAME_MIDDLE:
-NAME_LAST: Doe
-NAME_LAST:
-EMAIL_ADDRESS: john.doe@example.com
-EMAIL_ADDRESS: x.doe@example.com
-COMPANY_NAME: TestCo
-ADDRESS_HOME_LINE1: 1600 Amphitheatre Parkway
-ADDRESS_HOME_LINE2: (Bldg. 1950)
-ADDRESS_HOME_CITY: Mountain View
-ADDRESS_HOME_STATE: CA
-ADDRESS_HOME_ZIP: 94043
-ADDRESS_HOME_COUNTRY: United States
-PHONE_HOME_WHOLE_NUMBER: 6505558888
-PHONE_HOME_WHOLE_NUMBER: 6505559999
-PHONE_HOME_WHOLE_NUMBER: 6505559999
-PHONE_FAX_WHOLE_NUMBER: 6505556789
-PHONE_FAX_WHOLE_NUMBER: 6505551111
diff --git a/chrome/test/data/autofill/merge/input/identical.in b/chrome/test/data/autofill/merge/input/identical.in
index 6e1c6bc7..0d45be4 100644
--- a/chrome/test/data/autofill/merge/input/identical.in
+++ b/chrome/test/data/autofill/merge/input/identical.in
@@ -10,8 +10,8 @@ ADDRESS_HOME_CITY: Mountain View
ADDRESS_HOME_STATE: CA
ADDRESS_HOME_ZIP: 94043
ADDRESS_HOME_COUNTRY: United States
-PHONE_HOME_WHOLE_NUMBER: 6505558888
-PHONE_FAX_WHOLE_NUMBER: 6505556789
+PHONE_HOME_NUMBER: 6505558888
+PHONE_FAX_NUMBER: 6505556789
---
NAME_FIRST: John
NAME_MIDDLE: Kilgore
@@ -24,5 +24,5 @@ ADDRESS_HOME_CITY: Mountain View
ADDRESS_HOME_STATE: CA
ADDRESS_HOME_ZIP: 94043
ADDRESS_HOME_COUNTRY: United States
-PHONE_HOME_WHOLE_NUMBER: 6505558888
-PHONE_FAX_WHOLE_NUMBER: 6505556789
+PHONE_HOME_NUMBER: 6505558888
+PHONE_FAX_NUMBER: 6505556789
diff --git a/chrome/test/data/autofill/merge/input/multimerge.in b/chrome/test/data/autofill/merge/input/multimerge.in
deleted file mode 100644
index 9906c27..0000000
--- a/chrome/test/data/autofill/merge/input/multimerge.in
+++ /dev/null
@@ -1,28 +0,0 @@
----
-NAME_FIRST: Alice
-NAME_MIDDLE: Anne
-NAME_LAST: Akins
-EMAIL_ADDRESS: aa@a.com
-COMPANY_NAME: Acme
-ADDRESS_HOME_LINE1: 1 Main Street
-ADDRESS_HOME_LINE2: Apt 1
-ADDRESS_HOME_CITY: San Francisco
-ADDRESS_HOME_STATE: CA
-ADDRESS_HOME_ZIP: 94102
-ADDRESS_HOME_COUNTRY: United States
-PHONE_HOME_WHOLE_NUMBER: 1110001111
-PHONE_FAX_WHOLE_NUMBER: 8880008888
----
-NAME_FIRST: Billy
-NAME_MIDDLE: Bob
-NAME_LAST: Bruner
-EMAIL_ADDRESS: bb@b.com
-COMPANY_NAME: Acme
-ADDRESS_HOME_LINE1: 1 Main Street
-ADDRESS_HOME_LINE2: Apt 1
-ADDRESS_HOME_CITY: San Francisco
-ADDRESS_HOME_STATE: CA
-ADDRESS_HOME_ZIP: 94102
-ADDRESS_HOME_COUNTRY: United States
-PHONE_HOME_WHOLE_NUMBER: 2220003333
-PHONE_FAX_WHOLE_NUMBER: 8880008888
diff --git a/chrome/test/data/autofill/merge/input/singlemerge.in b/chrome/test/data/autofill/merge/input/singlemerge.in
deleted file mode 100644
index f264015..0000000
--- a/chrome/test/data/autofill/merge/input/singlemerge.in
+++ /dev/null
@@ -1,28 +0,0 @@
----
-NAME_FIRST: Alice
-NAME_MIDDLE: Anne
-NAME_LAST: Akins
-EMAIL_ADDRESS: aa@a.com
-COMPANY_NAME: Acme
-ADDRESS_HOME_LINE1: 1 Main Street
-ADDRESS_HOME_LINE2: Apt 1
-ADDRESS_HOME_CITY: San Francisco
-ADDRESS_HOME_STATE: CA
-ADDRESS_HOME_ZIP: 94102
-ADDRESS_HOME_COUNTRY: United States
-PHONE_HOME_WHOLE_NUMBER: 1110001111
-PHONE_FAX_WHOLE_NUMBER: 8880008888
----
-NAME_FIRST: Alice
-NAME_MIDDLE: Anne
-NAME_LAST: Akins
-EMAIL_ADDRESS: aa@a.com
-COMPANY_NAME: Box Co
-ADDRESS_HOME_LINE1: 1 Main Street
-ADDRESS_HOME_LINE2: Apt 2
-ADDRESS_HOME_CITY: San Francisco
-ADDRESS_HOME_STATE: NY
-ADDRESS_HOME_ZIP: 11001
-ADDRESS_HOME_COUNTRY: Canada
-PHONE_HOME_WHOLE_NUMBER: 1110001111
-PHONE_FAX_WHOLE_NUMBER: 8880008888
diff --git a/chrome/test/data/autofill/merge/input/validation.in b/chrome/test/data/autofill/merge/input/validation.in
index f148032..32ed1a8 100644
--- a/chrome/test/data/autofill/merge/input/validation.in
+++ b/chrome/test/data/autofill/merge/input/validation.in
@@ -9,8 +9,8 @@ ADDRESS_HOME_CITY: Mountain View
ADDRESS_HOME_STATE: CA
ADDRESS_HOME_ZIP: 94043
ADDRESS_HOME_COUNTRY: United States
-PHONE_HOME_WHOLE_NUMBER: 6505558888
-PHONE_FAX_WHOLE_NUMBER: 6505556789
+PHONE_HOME_NUMBER: 6505558888
+PHONE_FAX_NUMBER: 6505556789
---
NAME_FIRST: John
NAME_LAST: Doe
@@ -20,8 +20,8 @@ ADDRESS_HOME_CITY: Mountain View
ADDRESS_HOME_STATE: CA
ADDRESS_HOME_ZIP: 94043
ADDRESS_HOME_COUNTRY: United States
-PHONE_HOME_WHOLE_NUMBER: 6505558888
-PHONE_FAX_WHOLE_NUMBER: 6505556789
+PHONE_HOME_NUMBER: 6505558888
+PHONE_FAX_NUMBER: 6505556789
---
NAME_FIRST: Jim
NAME_LAST: Smith
@@ -49,8 +49,8 @@ ADDRESS_HOME_CITY: Mountain View
ADDRESS_HOME_STATE: CA
ADDRESS_HOME_ZIP: 94043
ADDRESS_HOME_COUNTRY: Bad Country
-PHONE_HOME_WHOLE_NUMBER: 6505558888
-PHONE_FAX_WHOLE_NUMBER: 6505556789
+PHONE_HOME_NUMBER: 6505558888
+PHONE_FAX_NUMBER: 6505556789
---
NAME_FIRST: Joe
NAME_LAST: Jones
@@ -61,8 +61,8 @@ ADDRESS_HOME_CITY: Mountain View
ADDRESS_HOME_STATE: BadState
ADDRESS_HOME_ZIP: 94043
ADDRESS_HOME_COUNTRY: United States
-PHONE_HOME_WHOLE_NUMBER: 6505558888
-PHONE_FAX_WHOLE_NUMBER: 6505556789
+PHONE_HOME_NUMBER: 6505558888
+PHONE_FAX_NUMBER: 6505556789
---
NAME_FIRST: Jim
NAME_LAST: Jones
@@ -73,5 +73,5 @@ ADDRESS_HOME_CITY: Mountain View
ADDRESS_HOME_STATE: CA
ADDRESS_HOME_ZIP: bogus
ADDRESS_HOME_COUNTRY: United States
-PHONE_HOME_WHOLE_NUMBER: 6505558888
-PHONE_FAX_WHOLE_NUMBER: 6505556789
+PHONE_HOME_NUMBER: 6505558888
+PHONE_FAX_NUMBER: 6505556789
diff --git a/chrome/test/data/autofill/merge/output/ambiguous.out b/chrome/test/data/autofill/merge/output/ambiguous.out
deleted file mode 100644
index e69de29..0000000
--- a/chrome/test/data/autofill/merge/output/ambiguous.out
+++ /dev/null
diff --git a/chrome/test/data/autofill/merge/output/identical.out b/chrome/test/data/autofill/merge/output/identical.out
index 8c6fb81..5ddb88c 100644
--- a/chrome/test/data/autofill/merge/output/identical.out
+++ b/chrome/test/data/autofill/merge/output/identical.out
@@ -10,5 +10,5 @@ ADDRESS_HOME_CITY: Mountain View
ADDRESS_HOME_STATE: CA
ADDRESS_HOME_ZIP: 94043
ADDRESS_HOME_COUNTRY: United States
-PHONE_HOME_WHOLE_NUMBER: 6505558888
-PHONE_FAX_WHOLE_NUMBER: 6505556789
+PHONE_HOME_NUMBER: 6505558888
+PHONE_FAX_NUMBER: 6505556789
diff --git a/chrome/test/data/autofill/merge/output/multimerge.out b/chrome/test/data/autofill/merge/output/multimerge.out
deleted file mode 100644
index 260f8bb..0000000
--- a/chrome/test/data/autofill/merge/output/multimerge.out
+++ /dev/null
@@ -1,19 +0,0 @@
----
-NAME_FIRST: Alice
-NAME_FIRST: Billy
-NAME_MIDDLE: Anne
-NAME_MIDDLE: Bob
-NAME_LAST: Akins
-NAME_LAST: Bruner
-EMAIL_ADDRESS: aa@a.com
-EMAIL_ADDRESS: bb@b.com
-COMPANY_NAME: Acme
-ADDRESS_HOME_LINE1: 1 Main Street
-ADDRESS_HOME_LINE2: Apt 1
-ADDRESS_HOME_CITY: San Francisco
-ADDRESS_HOME_STATE: CA
-ADDRESS_HOME_ZIP: 94102
-ADDRESS_HOME_COUNTRY: United States
-PHONE_HOME_WHOLE_NUMBER: 1110001111
-PHONE_HOME_WHOLE_NUMBER: 2220003333
-PHONE_FAX_WHOLE_NUMBER: 8880008888
diff --git a/chrome/test/data/autofill/merge/output/singlemerge.out b/chrome/test/data/autofill/merge/output/singlemerge.out
deleted file mode 100644
index 3181458..0000000
--- a/chrome/test/data/autofill/merge/output/singlemerge.out
+++ /dev/null
@@ -1,14 +0,0 @@
----
-NAME_FIRST: Alice
-NAME_MIDDLE: Anne
-NAME_LAST: Akins
-EMAIL_ADDRESS: aa@a.com
-COMPANY_NAME: Box Co
-ADDRESS_HOME_LINE1: 1 Main Street
-ADDRESS_HOME_LINE2: Apt 2
-ADDRESS_HOME_CITY: San Francisco
-ADDRESS_HOME_STATE: NY
-ADDRESS_HOME_ZIP: 11001
-ADDRESS_HOME_COUNTRY: Canada
-PHONE_HOME_WHOLE_NUMBER: 1110001111
-PHONE_FAX_WHOLE_NUMBER: 8880008888
diff --git a/chrome/test/data/autofill/merge/output/validation.out b/chrome/test/data/autofill/merge/output/validation.out
index 2925154..cc3c080 100644
--- a/chrome/test/data/autofill/merge/output/validation.out
+++ b/chrome/test/data/autofill/merge/output/validation.out
@@ -10,5 +10,5 @@ ADDRESS_HOME_CITY: Mountain View
ADDRESS_HOME_STATE: CA
ADDRESS_HOME_ZIP: 94043
ADDRESS_HOME_COUNTRY: United States
-PHONE_HOME_WHOLE_NUMBER: 6505558888
-PHONE_FAX_WHOLE_NUMBER: 6505556789
+PHONE_HOME_NUMBER: 6505558888
+PHONE_FAX_NUMBER: 6505556789