Chromium Code Reviews| Index: chrome/browser/ui/autofill/autofill_dialog_controller_browsertest.cc |
| diff --git a/chrome/browser/ui/autofill/autofill_dialog_controller_browsertest.cc b/chrome/browser/ui/autofill/autofill_dialog_controller_browsertest.cc |
| index 5a14f6432b560e32ef68d2944cb8b2d9b8436287..c5662da7be44aac1886ee2079ed45e3a78f63bcf 100644 |
| --- a/chrome/browser/ui/autofill/autofill_dialog_controller_browsertest.cc |
| +++ b/chrome/browser/ui/autofill/autofill_dialog_controller_browsertest.cc |
| @@ -1420,6 +1420,9 @@ IN_PROC_BROWSER_TEST_F(AutofillDialogControllerI18nTest, |
| EXPECT_TRUE(SectionHasField(SECTION_SHIPPING, ADDRESS_HOME_SORTING_CODE)); |
| } |
| +// Changing the data source to or from Wallet preserves the shipping country, |
| +// but not the billing country because Wallet only supports US billing |
| +// addresses. |
| IN_PROC_BROWSER_TEST_F(AutofillDialogControllerI18nTest, |
| ChangingDataSourcePreservesCountry) { |
| AutofillProfile verified_profile(test::GetVerifiedProfile()); |
| @@ -1439,19 +1442,14 @@ IN_PROC_BROWSER_TEST_F(AutofillDialogControllerI18nTest, |
| EXPECT_TRUE(controller()->IsPayingWithWallet()); |
| // Select "Add new billing/shipping address...". |
|
Dan Beam
2014/02/11 03:16:07
^ update
Evan Stade
2014/02/11 20:08:04
Done.
|
| - controller()->MenuModelForSection(SECTION_CC_BILLING)->ActivatedAt(1); |
| controller()->MenuModelForSection(SECTION_SHIPPING)->ActivatedAt(2); |
| scoped_ptr<AutofillDialogViewTester> view = GetViewTester(); |
| ASSERT_EQ(ASCIIToUTF16("United States"), |
| - view->GetTextContentsOfInput(ADDRESS_BILLING_COUNTRY)); |
| - ASSERT_EQ(ASCIIToUTF16("United States"), |
| view->GetTextContentsOfInput(ADDRESS_HOME_COUNTRY)); |
| - // Switch both billing and shipping countries. |
| - view->SetTextContentsOfInput(ADDRESS_BILLING_COUNTRY, ASCIIToUTF16("China")); |
| - view->ActivateInput(ADDRESS_BILLING_COUNTRY); |
| - view->SetTextContentsOfInput(ADDRESS_HOME_COUNTRY, ASCIIToUTF16("France")); |
| + // Switch the shipping country. |
| + view->SetTextContentsOfInput(ADDRESS_HOME_COUNTRY, ASCIIToUTF16("China")); |
| view->ActivateInput(ADDRESS_HOME_COUNTRY); |
| // Switch to using Autofill instead of Wallet. |
| @@ -1460,26 +1458,21 @@ IN_PROC_BROWSER_TEST_F(AutofillDialogControllerI18nTest, |
| EXPECT_FALSE(controller()->IsPayingWithWallet()); |
| - // Countries should have stayed the same. |
| + // Shipping country should have stayed the same. |
| EXPECT_EQ(ASCIIToUTF16("China"), |
| - view->GetTextContentsOfInput(ADDRESS_BILLING_COUNTRY)); |
| - EXPECT_EQ(ASCIIToUTF16("France"), |
| view->GetTextContentsOfInput(ADDRESS_HOME_COUNTRY)); |
| ASSERT_TRUE( |
| - SectionHasField(SECTION_BILLING, ADDRESS_BILLING_DEPENDENT_LOCALITY)); |
| + SectionHasField(SECTION_SHIPPING, ADDRESS_HOME_DEPENDENT_LOCALITY)); |
| - view->SetTextContentsOfInput(ADDRESS_BILLING_COUNTRY, |
| - ASCIIToUTF16("Antarctica")); |
| - view->ActivateInput(ADDRESS_BILLING_COUNTRY); |
| - |
| - // Select the first Wallet account. |
| + controller()->MenuModelForSection(SECTION_SHIPPING)->ActivatedAt(1); |
| + view->SetTextContentsOfInput(ADDRESS_BILLING_COUNTRY, ASCIIToUTF16("China")); |
|
Dan Beam
2014/02/11 03:16:07
view->ActivateInput(ADDRESS_BILLING_COUNTRY);
Evan Stade
2014/02/11 20:08:04
Done.
|
| + EXPECT_EQ(ASCIIToUTF16("China"), |
| + view->GetTextContentsOfInput(ADDRESS_BILLING_COUNTRY)); |
|
Dan Beam
2014/02/11 03:16:07
^ I don't see much value to this EXPECT_EQ() call
Evan Stade
2014/02/11 20:08:04
making sure the SetTextContentsOfInput call actual
|
| + // Switch back to Wallet. Country should go back to US. |
| account_chooser->ActivatedAt(0); |
| - ASSERT_TRUE(controller()->IsManuallyEditingSection(SECTION_CC_BILLING)); |
| - |
| - // Verify that inputs are rebuilt for billing sections across changes. |
| - EXPECT_FALSE( |
| - SectionHasField(SECTION_CC_BILLING, ADDRESS_BILLING_DEPENDENT_LOCALITY)); |
| + EXPECT_EQ(ASCIIToUTF16("United States"), |
| + view->GetTextContentsOfInput(ADDRESS_BILLING_COUNTRY)); |
|
Dan Beam
2014/02/11 03:16:07
please verify China/DEPENDENT_LOCALITY are still p
Evan Stade
2014/02/11 20:08:04
Done.
|
| } |
| IN_PROC_BROWSER_TEST_F(AutofillDialogControllerI18nTest, AddNewResetsCountry) { |