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

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

Issue 20420002: Make Wallet respect whether or not shipping address is required. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Wallet client respects delegates shipping preference. Created 7 years, 5 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_unittest.cc
diff --git a/chrome/browser/ui/autofill/autofill_dialog_controller_unittest.cc b/chrome/browser/ui/autofill/autofill_dialog_controller_unittest.cc
index a6478687516d85fc5d16b4519524d5bb8acbf637..2ee53942299959fc87a07726cf37ade42ce64349 100644
--- a/chrome/browser/ui/autofill/autofill_dialog_controller_unittest.cc
+++ b/chrome/browser/ui/autofill/autofill_dialog_controller_unittest.cc
@@ -2097,6 +2097,34 @@ TEST_F(AutofillDialogControllerTest, ShippingSectionCanBeHidden) {
EXPECT_TRUE(form_structure());
}
+TEST_F(AutofillDialogControllerTest, ShippingSectionCanBeHiddenForWallet) {
+ SwitchToWallet();
+
+ FormFieldData email_field;
+ email_field.autocomplete_attribute = "email";
+ FormFieldData cc_field;
+ cc_field.autocomplete_attribute = "cc-number";
+ FormFieldData billing_field;
+ billing_field.autocomplete_attribute = "billing region";
+
+ FormData form_data;
+ form_data.fields.push_back(email_field);
+ form_data.fields.push_back(cc_field);
+ form_data.fields.push_back(billing_field);
+
+ SetUpControllerWithFormData(form_data);
+ EXPECT_FALSE(controller()->SectionIsActive(SECTION_SHIPPING));
+ EXPECT_FALSE(controller()->IsShippingAddressRequired());
+
+ EXPECT_CALL(*controller()->GetTestingWalletClient(),
+ GetFullWallet(_)).Times(1);
+ scoped_ptr<wallet::WalletItems> wallet_items = wallet::GetTestWalletItems();
+ wallet_items->AddInstrument(wallet::GetTestMaskedInstrument());
+ SubmitWithWalletItems(wallet_items.Pass());
+ controller()->OnDidGetFullWallet(wallet::GetTestFullWalletInstrumentOnly());
+ EXPECT_TRUE(form_structure());
+}
+
TEST_F(AutofillDialogControllerTest, NotProdNotification) {
// To make IsPayingWithWallet() true.
controller()->OnDidGetWalletItems(wallet::GetTestWalletItems());

Powered by Google App Engine
This is Rietveld 408576698