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 <map> | 5 #include <map> |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 3517 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3528 TEST_F(AutofillDialogControllerTest, SwitchFromWalletWithFirstName) { | 3528 TEST_F(AutofillDialogControllerTest, SwitchFromWalletWithFirstName) { |
3529 controller()->MenuModelForSection(SECTION_CC_BILLING)->ActivatedAt(2); | 3529 controller()->MenuModelForSection(SECTION_CC_BILLING)->ActivatedAt(2); |
3530 | 3530 |
3531 FieldValueMap outputs; | 3531 FieldValueMap outputs; |
3532 outputs[NAME_FULL] = ASCIIToUTF16("madonna"); | 3532 outputs[NAME_FULL] = ASCIIToUTF16("madonna"); |
3533 controller()->GetView()->SetUserInput(SECTION_CC_BILLING, outputs); | 3533 controller()->GetView()->SetUserInput(SECTION_CC_BILLING, outputs); |
3534 | 3534 |
3535 ASSERT_NO_FATAL_FAILURE(SwitchToAutofill()); | 3535 ASSERT_NO_FATAL_FAILURE(SwitchToAutofill()); |
3536 } | 3536 } |
3537 | 3537 |
| 3538 // Regression test for http://crbug.com/382777 |
| 3539 TEST_F(AutofillDialogControllerTest, WalletBillingCountry) { |
| 3540 FormFieldData cc_field; |
| 3541 cc_field.autocomplete_attribute = "cc-number"; |
| 3542 FormFieldData billing_country, billing_country_name, shipping_country, |
| 3543 shipping_country_name; |
| 3544 billing_country.autocomplete_attribute = "billing country"; |
| 3545 billing_country_name.autocomplete_attribute = "billing country-name"; |
| 3546 shipping_country.autocomplete_attribute = "shipping country"; |
| 3547 shipping_country_name.autocomplete_attribute = "shipping country-name"; |
| 3548 |
| 3549 FormData form_data; |
| 3550 form_data.fields.push_back(cc_field); |
| 3551 form_data.fields.push_back(billing_country); |
| 3552 form_data.fields.push_back(billing_country_name); |
| 3553 form_data.fields.push_back(shipping_country); |
| 3554 form_data.fields.push_back(shipping_country_name); |
| 3555 |
| 3556 SetUpControllerWithFormData(form_data); |
| 3557 AcceptAndLoadFakeFingerprint(); |
| 3558 controller()->OnDidGetFullWallet(wallet::GetTestFullWallet()); |
| 3559 controller()->ForceFinishSubmit(); |
| 3560 |
| 3561 ASSERT_EQ(5U, form_structure()->field_count()); |
| 3562 EXPECT_EQ(ADDRESS_HOME_COUNTRY, |
| 3563 form_structure()->field(1)->Type().GetStorableType()); |
| 3564 EXPECT_EQ(ASCIIToUTF16("US"), form_structure()->field(1)->value); |
| 3565 EXPECT_EQ(ADDRESS_HOME_COUNTRY, |
| 3566 form_structure()->field(2)->Type().GetStorableType()); |
| 3567 EXPECT_EQ(ASCIIToUTF16("United States"), form_structure()->field(2)->value); |
| 3568 EXPECT_EQ(ADDRESS_HOME_COUNTRY, |
| 3569 form_structure()->field(3)->Type().GetStorableType()); |
| 3570 EXPECT_EQ(ASCIIToUTF16("US"), form_structure()->field(3)->value); |
| 3571 EXPECT_EQ(ADDRESS_HOME_COUNTRY, |
| 3572 form_structure()->field(4)->Type().GetStorableType()); |
| 3573 EXPECT_EQ(ASCIIToUTF16("United States"), form_structure()->field(4)->value); |
| 3574 } |
| 3575 |
3538 } // namespace autofill | 3576 } // namespace autofill |
OLD | NEW |