| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 498 LOG(WARNING) << "Typing 'M' to bring up the Autofill popup."; | 498 LOG(WARNING) << "Typing 'M' to bring up the Autofill popup."; |
| 499 SendKeyToPageAndWait(ui::VKEY_M); | 499 SendKeyToPageAndWait(ui::VKEY_M); |
| 500 | 500 |
| 501 // Press the down arrow to select the suggestion and preview the autofilled | 501 // Press the down arrow to select the suggestion and preview the autofilled |
| 502 // form. | 502 // form. |
| 503 LOG(WARNING) << "Simulating down arrow press to initiate Autofill preview."; | 503 LOG(WARNING) << "Simulating down arrow press to initiate Autofill preview."; |
| 504 SendKeyToPopupAndWait(ui::VKEY_DOWN); | 504 SendKeyToPopupAndWait(ui::VKEY_DOWN); |
| 505 | 505 |
| 506 // The previewed values should not be accessible to JavaScript. | 506 // The previewed values should not be accessible to JavaScript. |
| 507 ExpectFieldValue("firstname", "M"); | 507 ExpectFieldValue("firstname", "M"); |
| 508 ExpectFieldValue("lastname", ""); | 508 ExpectFieldValue("lastname", std::string()); |
| 509 ExpectFieldValue("address1", ""); | 509 ExpectFieldValue("address1", std::string()); |
| 510 ExpectFieldValue("address2", ""); | 510 ExpectFieldValue("address2", std::string()); |
| 511 ExpectFieldValue("city", ""); | 511 ExpectFieldValue("city", std::string()); |
| 512 ExpectFieldValue("state", ""); | 512 ExpectFieldValue("state", std::string()); |
| 513 ExpectFieldValue("zip", ""); | 513 ExpectFieldValue("zip", std::string()); |
| 514 ExpectFieldValue("country", ""); | 514 ExpectFieldValue("country", std::string()); |
| 515 ExpectFieldValue("phone", ""); | 515 ExpectFieldValue("phone", std::string()); |
| 516 // TODO(isherman): It would be nice to test that the previewed values are | 516 // TODO(isherman): It would be nice to test that the previewed values are |
| 517 // displayed: http://crbug.com/57220 | 517 // displayed: http://crbug.com/57220 |
| 518 | 518 |
| 519 // Press Enter to accept the autofill suggestions. | 519 // Press Enter to accept the autofill suggestions. |
| 520 LOG(WARNING) << "Simulating Return press to fill the form."; | 520 LOG(WARNING) << "Simulating Return press to fill the form."; |
| 521 SendKeyToPopupAndWait(ui::VKEY_RETURN); | 521 SendKeyToPopupAndWait(ui::VKEY_RETURN); |
| 522 | 522 |
| 523 // The form should be filled. | 523 // The form should be filled. |
| 524 ExpectFilledTestForm(); | 524 ExpectFilledTestForm(); |
| 525 } | 525 } |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 735 " <option value=\"\" selected=\"yes\">--</option>" | 735 " <option value=\"\" selected=\"yes\">--</option>" |
| 736 " <option value=\"CA\">Canada</option>" | 736 " <option value=\"CA\">Canada</option>" |
| 737 " <option value=\"US\">United States</option>" | 737 " <option value=\"US\">United States</option>" |
| 738 " </select><br>" | 738 " </select><br>" |
| 739 "<label for=\"phone\">Phone number:</label>" | 739 "<label for=\"phone\">Phone number:</label>" |
| 740 " <input type=\"text\" id=\"phone\"><br>" | 740 " <input type=\"text\" id=\"phone\"><br>" |
| 741 "</form>"))); | 741 "</form>"))); |
| 742 | 742 |
| 743 // Invoke Autofill. | 743 // Invoke Autofill. |
| 744 TryBasicFormFill(); | 744 TryBasicFormFill(); |
| 745 ExpectFieldValue("state_freeform", ""); | 745 ExpectFieldValue("state_freeform", std::string()); |
| 746 } | 746 } |
| 747 | 747 |
| 748 // http://crbug.com/150084 | 748 // http://crbug.com/150084 |
| 749 #if defined(OS_MACOSX) | 749 #if defined(OS_MACOSX) |
| 750 #define MAYBE_AutofillFormWithNonAutofillableField \ | 750 #define MAYBE_AutofillFormWithNonAutofillableField \ |
| 751 AutofillFormWithNonAutofillableField | 751 AutofillFormWithNonAutofillableField |
| 752 #else | 752 #else |
| 753 #define MAYBE_AutofillFormWithNonAutofillableField \ | 753 #define MAYBE_AutofillFormWithNonAutofillableField \ |
| 754 DISABLED_AutofillFormWithNonAutofillableField | 754 DISABLED_AutofillFormWithNonAutofillableField |
| 755 #endif | 755 #endif |
| (...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1300 ExpectFieldValue("ADDRESS_HOME_STATE", "CA"); | 1300 ExpectFieldValue("ADDRESS_HOME_STATE", "CA"); |
| 1301 ExpectFieldValue("ADDRESS_HOME_ZIP", "95110"); | 1301 ExpectFieldValue("ADDRESS_HOME_ZIP", "95110"); |
| 1302 ExpectFieldValue("PHONE_HOME_WHOLE_NUMBER", "14085554567"); | 1302 ExpectFieldValue("PHONE_HOME_WHOLE_NUMBER", "14085554567"); |
| 1303 ExpectFieldValue("PHONE_HOME_CITY_CODE-1", "408"); | 1303 ExpectFieldValue("PHONE_HOME_CITY_CODE-1", "408"); |
| 1304 ExpectFieldValue("PHONE_HOME_CITY_CODE-2", "408"); | 1304 ExpectFieldValue("PHONE_HOME_CITY_CODE-2", "408"); |
| 1305 ExpectFieldValue("PHONE_HOME_NUMBER", "5554567"); | 1305 ExpectFieldValue("PHONE_HOME_NUMBER", "5554567"); |
| 1306 ExpectFieldValue("PHONE_HOME_NUMBER_3-1", "555"); | 1306 ExpectFieldValue("PHONE_HOME_NUMBER_3-1", "555"); |
| 1307 ExpectFieldValue("PHONE_HOME_NUMBER_3-2", "555"); | 1307 ExpectFieldValue("PHONE_HOME_NUMBER_3-2", "555"); |
| 1308 ExpectFieldValue("PHONE_HOME_NUMBER_4-1", "4567"); | 1308 ExpectFieldValue("PHONE_HOME_NUMBER_4-1", "4567"); |
| 1309 ExpectFieldValue("PHONE_HOME_NUMBER_4-2", "4567"); | 1309 ExpectFieldValue("PHONE_HOME_NUMBER_4-2", "4567"); |
| 1310 ExpectFieldValue("PHONE_HOME_EXT-1", ""); | 1310 ExpectFieldValue("PHONE_HOME_EXT-1", std::string()); |
| 1311 ExpectFieldValue("PHONE_HOME_EXT-2", ""); | 1311 ExpectFieldValue("PHONE_HOME_EXT-2", std::string()); |
| 1312 ExpectFieldValue("PHONE_HOME_COUNTRY_CODE-1", "1"); | 1312 ExpectFieldValue("PHONE_HOME_COUNTRY_CODE-1", "1"); |
| 1313 } | 1313 } |
| 1314 | 1314 |
| 1315 // Test profile is saved if phone number is valid in selected country. | 1315 // Test profile is saved if phone number is valid in selected country. |
| 1316 // The data file contains two profiles with valid phone numbers and two | 1316 // The data file contains two profiles with valid phone numbers and two |
| 1317 // profiles with invalid phone numbers from their respective country. | 1317 // profiles with invalid phone numbers from their respective country. |
| 1318 // DISABLED: http://crbug.com/150084 | 1318 // DISABLED: http://crbug.com/150084 |
| 1319 IN_PROC_BROWSER_TEST_F(AutofillTest, | 1319 IN_PROC_BROWSER_TEST_F(AutofillTest, |
| 1320 DISABLED_ProfileSavedWithValidCountryPhone) { | 1320 DISABLED_ProfileSavedWithValidCountryPhone) { |
| 1321 ASSERT_TRUE(test_server()->Start()); | 1321 ASSERT_TRUE(test_server()->Start()); |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1440 profile.SetRawInfo(ADDRESS_HOME_STATE, ASCIIToUTF16("CA")); | 1440 profile.SetRawInfo(ADDRESS_HOME_STATE, ASCIIToUTF16("CA")); |
| 1441 profile.SetRawInfo(ADDRESS_HOME_ZIP, ASCIIToUTF16("95110")); | 1441 profile.SetRawInfo(ADDRESS_HOME_ZIP, ASCIIToUTF16("95110")); |
| 1442 profile.SetRawInfo(COMPANY_NAME, ASCIIToUTF16("Company X")); | 1442 profile.SetRawInfo(COMPANY_NAME, ASCIIToUTF16("Company X")); |
| 1443 profile.SetRawInfo(PHONE_HOME_WHOLE_NUMBER, ASCIIToUTF16("408-871-4567")); | 1443 profile.SetRawInfo(PHONE_HOME_WHOLE_NUMBER, ASCIIToUTF16("408-871-4567")); |
| 1444 SetProfile(profile); | 1444 SetProfile(profile); |
| 1445 | 1445 |
| 1446 GURL url = test_server()->GetURL("files/autofill/read_only_field_test.html"); | 1446 GURL url = test_server()->GetURL("files/autofill/read_only_field_test.html"); |
| 1447 ui_test_utils::NavigateToURL(browser(), url); | 1447 ui_test_utils::NavigateToURL(browser(), url); |
| 1448 PopulateForm("firstname"); | 1448 PopulateForm("firstname"); |
| 1449 | 1449 |
| 1450 ExpectFieldValue("email", ""); | 1450 ExpectFieldValue("email", std::string()); |
| 1451 ExpectFieldValue("address", addr_line1); | 1451 ExpectFieldValue("address", addr_line1); |
| 1452 } | 1452 } |
| 1453 | 1453 |
| 1454 // http://crbug.com/150084 | 1454 // http://crbug.com/150084 |
| 1455 #if defined(OS_MACOSX) | 1455 #if defined(OS_MACOSX) |
| 1456 #define MAYBE_FormFillableOnReset FormFillableOnReset | 1456 #define MAYBE_FormFillableOnReset FormFillableOnReset |
| 1457 #else | 1457 #else |
| 1458 #define MAYBE_FormFillableOnReset DISABLED_FormFillableOnReset | 1458 #define MAYBE_FormFillableOnReset DISABLED_FormFillableOnReset |
| 1459 #endif | 1459 #endif |
| 1460 // Test form is fillable from a profile after form was reset. | 1460 // Test form is fillable from a profile after form was reset. |
| (...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1712 // TODO(isherman): this looks redundant, consider removing. | 1712 // TODO(isherman): this looks redundant, consider removing. |
| 1713 // DISABLED: http://crbug.com/150084 | 1713 // DISABLED: http://crbug.com/150084 |
| 1714 IN_PROC_BROWSER_TEST_F(AutofillTest, | 1714 IN_PROC_BROWSER_TEST_F(AutofillTest, |
| 1715 DISABLED_MergeAggregatedDuplicatedProfiles) { | 1715 DISABLED_MergeAggregatedDuplicatedProfiles) { |
| 1716 int num_of_profiles = | 1716 int num_of_profiles = |
| 1717 AggregateProfilesIntoAutofillPrefs("dataset_no_address.txt"); | 1717 AggregateProfilesIntoAutofillPrefs("dataset_no_address.txt"); |
| 1718 | 1718 |
| 1719 ASSERT_GT(num_of_profiles, | 1719 ASSERT_GT(num_of_profiles, |
| 1720 static_cast<int>(personal_data_manager()->GetProfiles().size())); | 1720 static_cast<int>(personal_data_manager()->GetProfiles().size())); |
| 1721 } | 1721 } |
| OLD | NEW |