Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1056)

Unified Diff: chrome/browser/ui/autofill/autofill_dialog_controller_browsertest.cc

Issue 157093002: rAc - hardcode wallet billing address to US in i18n mode (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tests find bugs, me fix bugs, tests have bugs, me fix tests Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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) {

Powered by Google App Engine
This is Rietveld 408576698