Chromium Code Reviews| 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 423badcc9794d815992240739011bbffd06b9fb1..2481ba1a1fb86f49320fd0512b418cfb97dc4c75 100644 |
| --- a/chrome/browser/ui/autofill/autofill_dialog_controller_unittest.cc |
| +++ b/chrome/browser/ui/autofill/autofill_dialog_controller_unittest.cc |
| @@ -1312,4 +1312,30 @@ TEST_F(AutofillDialogControllerTest, SaveDetailsInChrome) { |
| EXPECT_FALSE(controller()->ShouldOfferToSaveInChrome()); |
| } |
| +TEST_F(AutofillDialogControllerTest, NoManageMenuItemForNewWalletUsers) { |
| + // Make sure the menu model item is created when desired. |
|
Evan Stade
2013/05/23 16:32:12
s/when desired/for a returning Wallet user.
Dan Beam
2013/05/23 19:31:16
Done.
|
| + 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 when unwanted. |
|
Evan Stade
2013/05/23 16:32:12
s/when unwanted/for new wallet users.
Dan Beam
2013/05/23 19:31:16
Done.
|
| + 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 |