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

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

Issue 15742018: Omit "Manage your X..." menu model items when user is new. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 7 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
« no previous file with comments | « chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 92de86c90e3730bc74b7493789179bf464aebc08..8f93a778898b0bf340deb80687fba1b282c1c474 100644
--- a/chrome/browser/ui/autofill/autofill_dialog_controller_unittest.cc
+++ b/chrome/browser/ui/autofill/autofill_dialog_controller_unittest.cc
@@ -1404,4 +1404,30 @@ TEST_F(AutofillDialogControllerTest, SaveDetailsInChrome) {
EXPECT_FALSE(controller()->ShouldOfferToSaveInChrome());
}
+TEST_F(AutofillDialogControllerTest, NoManageMenuItemForNewWalletUsers) {
+ // Make sure the menu model item is created for a returning Wallet user.
+ scoped_ptr<wallet::WalletItems> wallet_items = wallet::GetTestWalletItems();
+ wallet_items->AddInstrument(wallet::GetTestMaskedInstrument());
+ wallet_items->AddAddress(wallet::GetTestShippingAddress());
+ controller()->OnDidGetWalletItems(wallet_items.Pass());
+
+ EXPECT_TRUE(controller()->MenuModelForSection(SECTION_CC_BILLING));
+ // "Same as billing", "123 address", "Add address...", and "Manage addresses".
+ EXPECT_EQ(
+ 4, controller()->MenuModelForSection(SECTION_SHIPPING)->GetItemCount());
+
+ // Make sure the menu model item is not created for new Wallet users.
+ base::DictionaryValue dict;
+ scoped_ptr<base::ListValue> required_actions(new base::ListValue);
+ required_actions->AppendString("setup_wallet");
+ dict.Set("required_action", required_actions.release());
+ controller()->OnDidGetWalletItems(
+ wallet::WalletItems::CreateWalletItems(dict).Pass());
+
+ EXPECT_FALSE(controller()->MenuModelForSection(SECTION_CC_BILLING));
+ // "Same as billing" and "Add address...".
+ EXPECT_EQ(
+ 2, controller()->MenuModelForSection(SECTION_SHIPPING)->GetItemCount());
+}
+
} // namespace autofill
« no previous file with comments | « chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698