| Index: components/autofill/core/browser/personal_data_manager_unittest.cc
|
| diff --git a/components/autofill/core/browser/personal_data_manager_unittest.cc b/components/autofill/core/browser/personal_data_manager_unittest.cc
|
| index 7c08e5f898305b5c6418c5b577ac08dbf8c0dc5c..36d9fb1c5aafc5bf1d4194ea99f2db863b1f0ed0 100644
|
| --- a/components/autofill/core/browser/personal_data_manager_unittest.cc
|
| +++ b/components/autofill/core/browser/personal_data_manager_unittest.cc
|
| @@ -594,7 +594,7 @@ TEST_F(PersonalDataManagerTest, ImportFormData) {
|
| form.fields.push_back(field);
|
| test::CreateTestFormField("Zip:", "zip", "94102", "text", &field);
|
| form.fields.push_back(field);
|
| - FormStructure form_structure(form, std::string());
|
| + FormStructure form_structure(form);
|
| form_structure.DetermineHeuristicTypes(TestAutofillMetrics());
|
| const CreditCard* imported_credit_card;
|
| EXPECT_TRUE(personal_data_->ImportFormData(form_structure,
|
| @@ -635,7 +635,7 @@ TEST_F(PersonalDataManagerTest, ImportFormDataBadEmail) {
|
| form.fields.push_back(field);
|
| test::CreateTestFormField("Zip:", "zip", "94102", "text", &field);
|
| form.fields.push_back(field);
|
| - FormStructure form_structure(form, std::string());
|
| + FormStructure form_structure(form);
|
| form_structure.DetermineHeuristicTypes(TestAutofillMetrics());
|
| const CreditCard* imported_credit_card;
|
| EXPECT_FALSE(personal_data_->ImportFormData(form_structure,
|
| @@ -668,7 +668,7 @@ TEST_F(PersonalDataManagerTest, ImportFormDataTwoEmails) {
|
| test::CreateTestFormField(
|
| "Confirm email:", "confirm_email", "example@example.com", "text", &field);
|
| form.fields.push_back(field);
|
| - FormStructure form_structure(form, std::string());
|
| + FormStructure form_structure(form);
|
| form_structure.DetermineHeuristicTypes(TestAutofillMetrics());
|
| const CreditCard* imported_credit_card;
|
| EXPECT_TRUE(personal_data_->ImportFormData(form_structure,
|
| @@ -699,7 +699,7 @@ TEST_F(PersonalDataManagerTest, ImportFormDataTwoDifferentEmails) {
|
| test::CreateTestFormField(
|
| "Email:", "email2", "example2@example.com", "text", &field);
|
| form.fields.push_back(field);
|
| - FormStructure form_structure(form, std::string());
|
| + FormStructure form_structure(form);
|
| form_structure.DetermineHeuristicTypes(TestAutofillMetrics());
|
| const CreditCard* imported_credit_card;
|
| EXPECT_FALSE(personal_data_->ImportFormData(form_structure,
|
| @@ -720,7 +720,7 @@ TEST_F(PersonalDataManagerTest, ImportFormDataNotEnoughFilledFields) {
|
| test::CreateTestFormField(
|
| "Card number:", "card_number", "4111 1111 1111 1111", "text", &field);
|
| form.fields.push_back(field);
|
| - FormStructure form_structure(form, std::string());
|
| + FormStructure form_structure(form);
|
| form_structure.DetermineHeuristicTypes(TestAutofillMetrics());
|
| const CreditCard* imported_credit_card;
|
| EXPECT_FALSE(personal_data_->ImportFormData(form_structure,
|
| @@ -751,7 +751,7 @@ TEST_F(PersonalDataManagerTest, ImportFormMinimumAddressUSA) {
|
| form.fields.push_back(field);
|
| test::CreateTestFormField("Country:", "country", "USA", "text", &field);
|
| form.fields.push_back(field);
|
| - FormStructure form_structure(form, std::string());
|
| + FormStructure form_structure(form);
|
| form_structure.DetermineHeuristicTypes(TestAutofillMetrics());
|
| const CreditCard* imported_credit_card;
|
| EXPECT_TRUE(personal_data_->ImportFormData(form_structure,
|
| @@ -778,7 +778,7 @@ TEST_F(PersonalDataManagerTest, ImportFormMinimumAddressGB) {
|
| test::CreateTestFormField(
|
| "Country:", "country", "United Kingdom", "text", &field);
|
| form.fields.push_back(field);
|
| - FormStructure form_structure(form, std::string());
|
| + FormStructure form_structure(form);
|
| form_structure.DetermineHeuristicTypes(TestAutofillMetrics());
|
| const CreditCard* imported_credit_card;
|
| EXPECT_TRUE(personal_data_->ImportFormData(form_structure,
|
| @@ -800,7 +800,7 @@ TEST_F(PersonalDataManagerTest, ImportFormMinimumAddressGI) {
|
| form.fields.push_back(field);
|
| test::CreateTestFormField("Country:", "country", "Gibraltar", "text", &field);
|
| form.fields.push_back(field);
|
| - FormStructure form_structure(form, std::string());
|
| + FormStructure form_structure(form);
|
| form_structure.DetermineHeuristicTypes(TestAutofillMetrics());
|
| const CreditCard* imported_credit_card;
|
| EXPECT_TRUE(personal_data_->ImportFormData(form_structure,
|
| @@ -839,7 +839,7 @@ TEST_F(PersonalDataManagerTest, ImportPhoneNumberSplitAcrossMultipleFields) {
|
| form.fields.push_back(field);
|
| test::CreateTestFormField("Zip:", "zip", "94102", "text", &field);
|
| form.fields.push_back(field);
|
| - FormStructure form_structure(form, std::string());
|
| + FormStructure form_structure(form);
|
| form_structure.DetermineHeuristicTypes(TestAutofillMetrics());
|
| const CreditCard* imported_credit_card;
|
| EXPECT_TRUE(personal_data_->ImportFormData(form_structure,
|
| @@ -919,7 +919,7 @@ TEST_F(PersonalDataManagerTest, AggregateTwoDifferentProfiles) {
|
| test::CreateTestFormField("Zip:", "zip", "94102", "text", &field);
|
| form1.fields.push_back(field);
|
|
|
| - FormStructure form_structure1(form1, std::string());
|
| + FormStructure form_structure1(form1);
|
| form_structure1.DetermineHeuristicTypes(TestAutofillMetrics());
|
| const CreditCard* imported_credit_card;
|
| EXPECT_TRUE(personal_data_->ImportFormData(form_structure1,
|
| @@ -960,7 +960,7 @@ TEST_F(PersonalDataManagerTest, AggregateTwoDifferentProfiles) {
|
| test::CreateTestFormField("Zip:", "zip", "94102", "text", &field);
|
| form2.fields.push_back(field);
|
|
|
| - FormStructure form_structure2(form2, std::string());
|
| + FormStructure form_structure2(form2);
|
| form_structure2.DetermineHeuristicTypes(TestAutofillMetrics());
|
| EXPECT_TRUE(personal_data_->ImportFormData(form_structure2,
|
| &imported_credit_card));
|
| @@ -1004,7 +1004,7 @@ TEST_F(PersonalDataManagerTest, AggregateTwoProfilesWithMultiValue) {
|
| test::CreateTestFormField("Zip:", "zip", "94102", "text", &field);
|
| form1.fields.push_back(field);
|
|
|
| - FormStructure form_structure1(form1, std::string());
|
| + FormStructure form_structure1(form1);
|
| form_structure1.DetermineHeuristicTypes(TestAutofillMetrics());
|
| const CreditCard* imported_credit_card;
|
| EXPECT_TRUE(personal_data_->ImportFormData(form_structure1,
|
| @@ -1044,7 +1044,7 @@ TEST_F(PersonalDataManagerTest, AggregateTwoProfilesWithMultiValue) {
|
| test::CreateTestFormField("Zip:", "zip", "94102", "text", &field);
|
| form2.fields.push_back(field);
|
|
|
| - FormStructure form_structure2(form2, std::string());
|
| + FormStructure form_structure2(form2);
|
| form_structure2.DetermineHeuristicTypes(TestAutofillMetrics());
|
| EXPECT_TRUE(personal_data_->ImportFormData(form_structure2,
|
| &imported_credit_card));
|
| @@ -1097,7 +1097,7 @@ TEST_F(PersonalDataManagerTest, AggregateSameProfileWithConflict) {
|
| test::CreateTestFormField("Phone:", "phone", "6505556666", "text", &field);
|
| form1.fields.push_back(field);
|
|
|
| - FormStructure form_structure1(form1, std::string());
|
| + FormStructure form_structure1(form1);
|
| form_structure1.DetermineHeuristicTypes(TestAutofillMetrics());
|
| const CreditCard* imported_credit_card;
|
| EXPECT_TRUE(personal_data_->ImportFormData(form_structure1,
|
| @@ -1148,7 +1148,7 @@ TEST_F(PersonalDataManagerTest, AggregateSameProfileWithConflict) {
|
| test::CreateTestFormField("Phone:", "phone", "6502231234", "text", &field);
|
| form2.fields.push_back(field);
|
|
|
| - FormStructure form_structure2(form2, std::string());
|
| + FormStructure form_structure2(form2);
|
| form_structure2.DetermineHeuristicTypes(TestAutofillMetrics());
|
| EXPECT_TRUE(personal_data_->ImportFormData(form_structure2,
|
| &imported_credit_card));
|
| @@ -1190,7 +1190,7 @@ TEST_F(PersonalDataManagerTest, AggregateProfileWithMissingInfoInOld) {
|
| test::CreateTestFormField("Zip:", "zipcode", "19106", "text", &field);
|
| form1.fields.push_back(field);
|
|
|
| - FormStructure form_structure1(form1, std::string());
|
| + FormStructure form_structure1(form1);
|
| form_structure1.DetermineHeuristicTypes(TestAutofillMetrics());
|
| const CreditCard* imported_credit_card;
|
| EXPECT_TRUE(personal_data_->ImportFormData(form_structure1,
|
| @@ -1231,7 +1231,7 @@ TEST_F(PersonalDataManagerTest, AggregateProfileWithMissingInfoInOld) {
|
| test::CreateTestFormField("Zip:", "zipcode", "19106", "text", &field);
|
| form2.fields.push_back(field);
|
|
|
| - FormStructure form_structure2(form2, std::string());
|
| + FormStructure form_structure2(form2);
|
| form_structure2.DetermineHeuristicTypes(TestAutofillMetrics());
|
| EXPECT_TRUE(personal_data_->ImportFormData(form_structure2,
|
| &imported_credit_card));
|
| @@ -1277,7 +1277,7 @@ TEST_F(PersonalDataManagerTest, AggregateProfileWithMissingInfoInNew) {
|
| test::CreateTestFormField("Zip:", "zipcode", "19106", "text", &field);
|
| form1.fields.push_back(field);
|
|
|
| - FormStructure form_structure1(form1, std::string());
|
| + FormStructure form_structure1(form1);
|
| form_structure1.DetermineHeuristicTypes(TestAutofillMetrics());
|
| const CreditCard* imported_credit_card;
|
| EXPECT_TRUE(personal_data_->ImportFormData(form_structure1,
|
| @@ -1319,7 +1319,7 @@ TEST_F(PersonalDataManagerTest, AggregateProfileWithMissingInfoInNew) {
|
| test::CreateTestFormField("Zip:", "zipcode", "19106", "text", &field);
|
| form2.fields.push_back(field);
|
|
|
| - FormStructure form_structure2(form2, std::string());
|
| + FormStructure form_structure2(form2);
|
| form_structure2.DetermineHeuristicTypes(TestAutofillMetrics());
|
| EXPECT_TRUE(personal_data_->ImportFormData(form_structure2,
|
| &imported_credit_card));
|
| @@ -1358,7 +1358,7 @@ TEST_F(PersonalDataManagerTest, AggregateProfileWithInsufficientAddress) {
|
| test::CreateTestFormField("City:", "city", "Philadelphia", "text", &field);
|
| form1.fields.push_back(field);
|
|
|
| - FormStructure form_structure1(form1, std::string());
|
| + FormStructure form_structure1(form1);
|
| form_structure1.DetermineHeuristicTypes(TestAutofillMetrics());
|
| const CreditCard* imported_credit_card;
|
| EXPECT_FALSE(personal_data_->ImportFormData(form_structure1,
|
| @@ -1412,7 +1412,7 @@ TEST_F(PersonalDataManagerTest, AggregateExistingAuxiliaryProfile) {
|
| test::CreateTestFormField("Phone:", "phone", "4158889999", "text", &field);
|
| form.fields.push_back(field);
|
|
|
| - FormStructure form_structure(form, std::string());
|
| + FormStructure form_structure(form);
|
| form_structure.DetermineHeuristicTypes(TestAutofillMetrics());
|
| const CreditCard* imported_credit_card;
|
| EXPECT_TRUE(personal_data_->ImportFormData(form_structure,
|
| @@ -1445,7 +1445,7 @@ TEST_F(PersonalDataManagerTest, AggregateTwoDifferentCreditCards) {
|
| test::CreateTestFormField("Exp Year:", "exp_year", "2011", "text", &field);
|
| form1.fields.push_back(field);
|
|
|
| - FormStructure form_structure1(form1, std::string());
|
| + FormStructure form_structure1(form1);
|
| form_structure1.DetermineHeuristicTypes(TestAutofillMetrics());
|
| const CreditCard* imported_credit_card;
|
| EXPECT_TRUE(personal_data_->ImportFormData(form_structure1,
|
| @@ -1479,7 +1479,7 @@ TEST_F(PersonalDataManagerTest, AggregateTwoDifferentCreditCards) {
|
| test::CreateTestFormField("Exp Year:", "exp_year", "2012", "text", &field);
|
| form2.fields.push_back(field);
|
|
|
| - FormStructure form_structure2(form2, std::string());
|
| + FormStructure form_structure2(form2);
|
| form_structure2.DetermineHeuristicTypes(TestAutofillMetrics());
|
| EXPECT_TRUE(personal_data_->ImportFormData(form_structure2,
|
| &imported_credit_card));
|
| @@ -1516,7 +1516,7 @@ TEST_F(PersonalDataManagerTest, AggregateInvalidCreditCard) {
|
| test::CreateTestFormField("Exp Year:", "exp_year", "2011", "text", &field);
|
| form1.fields.push_back(field);
|
|
|
| - FormStructure form_structure1(form1, std::string());
|
| + FormStructure form_structure1(form1);
|
| form_structure1.DetermineHeuristicTypes(TestAutofillMetrics());
|
| const CreditCard* imported_credit_card;
|
| EXPECT_TRUE(personal_data_->ImportFormData(form_structure1,
|
| @@ -1550,7 +1550,7 @@ TEST_F(PersonalDataManagerTest, AggregateInvalidCreditCard) {
|
| test::CreateTestFormField("Exp Year:", "exp_year", "2012", "text", &field);
|
| form2.fields.push_back(field);
|
|
|
| - FormStructure form_structure2(form2, std::string());
|
| + FormStructure form_structure2(form2);
|
| form_structure2.DetermineHeuristicTypes(TestAutofillMetrics());
|
| EXPECT_FALSE(personal_data_->ImportFormData(form_structure2,
|
| &imported_credit_card));
|
| @@ -1581,7 +1581,7 @@ TEST_F(PersonalDataManagerTest, AggregateSameCreditCardWithConflict) {
|
| test::CreateTestFormField("Exp Year:", "exp_year", "2011", "text", &field);
|
| form1.fields.push_back(field);
|
|
|
| - FormStructure form_structure1(form1, std::string());
|
| + FormStructure form_structure1(form1);
|
| form_structure1.DetermineHeuristicTypes(TestAutofillMetrics());
|
| const CreditCard* imported_credit_card;
|
| EXPECT_TRUE(personal_data_->ImportFormData(form_structure1,
|
| @@ -1616,7 +1616,7 @@ TEST_F(PersonalDataManagerTest, AggregateSameCreditCardWithConflict) {
|
| test::CreateTestFormField("Exp Year:", "exp_year", "2012", "text", &field);
|
| form2.fields.push_back(field);
|
|
|
| - FormStructure form_structure2(form2, std::string());
|
| + FormStructure form_structure2(form2);
|
| form_structure2.DetermineHeuristicTypes(TestAutofillMetrics());
|
| EXPECT_TRUE(personal_data_->ImportFormData(form_structure2,
|
| &imported_credit_card));
|
| @@ -1653,7 +1653,7 @@ TEST_F(PersonalDataManagerTest, AggregateEmptyCreditCardWithConflict) {
|
| test::CreateTestFormField("Exp Year:", "exp_year", "2011", "text", &field);
|
| form1.fields.push_back(field);
|
|
|
| - FormStructure form_structure1(form1, std::string());
|
| + FormStructure form_structure1(form1);
|
| form_structure1.DetermineHeuristicTypes(TestAutofillMetrics());
|
| const CreditCard* imported_credit_card;
|
| EXPECT_TRUE(personal_data_->ImportFormData(form_structure1,
|
| @@ -1684,7 +1684,7 @@ TEST_F(PersonalDataManagerTest, AggregateEmptyCreditCardWithConflict) {
|
| test::CreateTestFormField("Exp Year:", "exp_year", "2012", "text", &field);
|
| form2.fields.push_back(field);
|
|
|
| - FormStructure form_structure2(form2, std::string());
|
| + FormStructure form_structure2(form2);
|
| form_structure2.DetermineHeuristicTypes(TestAutofillMetrics());
|
| EXPECT_FALSE(personal_data_->ImportFormData(form_structure2,
|
| &imported_credit_card));
|
| @@ -1719,7 +1719,7 @@ TEST_F(PersonalDataManagerTest, AggregateCreditCardWithMissingInfoInNew) {
|
| test::CreateTestFormField("Exp Year:", "exp_year", "2011", "text", &field);
|
| form1.fields.push_back(field);
|
|
|
| - FormStructure form_structure1(form1, std::string());
|
| + FormStructure form_structure1(form1);
|
| form_structure1.DetermineHeuristicTypes(TestAutofillMetrics());
|
| const CreditCard* imported_credit_card;
|
| EXPECT_TRUE(personal_data_->ImportFormData(form_structure1,
|
| @@ -1752,7 +1752,7 @@ TEST_F(PersonalDataManagerTest, AggregateCreditCardWithMissingInfoInNew) {
|
| test::CreateTestFormField("Exp Year:", "exp_year", "2011", "text", &field);
|
| form2.fields.push_back(field);
|
|
|
| - FormStructure form_structure2(form2, std::string());
|
| + FormStructure form_structure2(form2);
|
| form_structure2.DetermineHeuristicTypes(TestAutofillMetrics());
|
| EXPECT_TRUE(personal_data_->ImportFormData(form_structure2,
|
| &imported_credit_card));
|
| @@ -1780,7 +1780,7 @@ TEST_F(PersonalDataManagerTest, AggregateCreditCardWithMissingInfoInNew) {
|
| form3.fields.push_back(field);
|
| // Note missing expiration month and year..
|
|
|
| - FormStructure form_structure3(form3, std::string());
|
| + FormStructure form_structure3(form3);
|
| form_structure3.DetermineHeuristicTypes(TestAutofillMetrics());
|
| EXPECT_FALSE(personal_data_->ImportFormData(form_structure3,
|
| &imported_credit_card));
|
| @@ -1832,7 +1832,7 @@ TEST_F(PersonalDataManagerTest, AggregateCreditCardWithMissingInfoInOld) {
|
| test::CreateTestFormField("Exp Year:", "exp_year", "2012", "text", &field);
|
| form.fields.push_back(field);
|
|
|
| - FormStructure form_structure(form, std::string());
|
| + FormStructure form_structure(form);
|
| form_structure.DetermineHeuristicTypes(TestAutofillMetrics());
|
| const CreditCard* imported_credit_card;
|
| EXPECT_TRUE(personal_data_->ImportFormData(form_structure,
|
| @@ -1887,7 +1887,7 @@ TEST_F(PersonalDataManagerTest, AggregateSameCreditCardWithSeparators) {
|
| test::CreateTestFormField("Exp Year:", "exp_year", "2011", "text", &field);
|
| form.fields.push_back(field);
|
|
|
| - FormStructure form_structure(form, std::string());
|
| + FormStructure form_structure(form);
|
| form_structure.DetermineHeuristicTypes(TestAutofillMetrics());
|
| const CreditCard* imported_credit_card;
|
| EXPECT_TRUE(personal_data_->ImportFormData(form_structure,
|
| @@ -1945,7 +1945,7 @@ TEST_F(PersonalDataManagerTest, AggregateExistingVerifiedProfileWithConflict) {
|
| test::CreateTestFormField("Zip:", "zip", "91601", "text", &field);
|
| form.fields.push_back(field);
|
|
|
| - FormStructure form_structure(form, std::string());
|
| + FormStructure form_structure(form);
|
| form_structure.DetermineHeuristicTypes(TestAutofillMetrics());
|
| const CreditCard* imported_credit_card;
|
| EXPECT_TRUE(personal_data_->ImportFormData(form_structure,
|
| @@ -1995,7 +1995,7 @@ TEST_F(PersonalDataManagerTest,
|
| test::CreateTestFormField("Exp Year:", "exp_year", "2012", "text", &field);
|
| form.fields.push_back(field);
|
|
|
| - FormStructure form_structure(form, std::string());
|
| + FormStructure form_structure(form);
|
| form_structure.DetermineHeuristicTypes(TestAutofillMetrics());
|
| const CreditCard* imported_credit_card;
|
| EXPECT_TRUE(personal_data_->ImportFormData(form_structure,
|
| @@ -2278,7 +2278,7 @@ TEST_F(PersonalDataManagerTest, CaseInsensitiveMultiValueAggregation) {
|
| "Phone number:", "phone_number", "817-555-6789", "text", &field);
|
| form1.fields.push_back(field);
|
|
|
| - FormStructure form_structure1(form1, std::string());
|
| + FormStructure form_structure1(form1);
|
| form_structure1.DetermineHeuristicTypes(TestAutofillMetrics());
|
| const CreditCard* imported_credit_card;
|
| EXPECT_TRUE(personal_data_->ImportFormData(form_structure1,
|
| @@ -2322,7 +2322,7 @@ TEST_F(PersonalDataManagerTest, CaseInsensitiveMultiValueAggregation) {
|
| "Phone number:", "phone_number", "214-555-1234", "text", &field);
|
| form2.fields.push_back(field);
|
|
|
| - FormStructure form_structure2(form2, std::string());
|
| + FormStructure form_structure2(form2);
|
| form_structure2.DetermineHeuristicTypes(TestAutofillMetrics());
|
| EXPECT_TRUE(personal_data_->ImportFormData(form_structure2,
|
| &imported_credit_card));
|
|
|