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

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

Issue 14129005: Remove "Use billing for shipping" checkbox in favor of item in suggestions menu. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 8 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 9e43443e5833a26a5b4cb65b384dbb5e9cbfe290..b84a5e437834a660e28c58237702ec20573a6b5c 100644
--- a/chrome/browser/ui/autofill/autofill_dialog_controller_unittest.cc
+++ b/chrome/browser/ui/autofill/autofill_dialog_controller_unittest.cc
@@ -55,7 +55,6 @@ class TestAutofillDialogView : public AutofillDialogView {
}
virtual string16 GetCvc() OVERRIDE { return string16(); }
- virtual bool UseBillingForShipping() OVERRIDE { return false; }
virtual bool SaveDetailsLocally() OVERRIDE { return true; }
virtual const content::NavigationController* ShowSignIn() OVERRIDE {
return NULL;
@@ -364,8 +363,8 @@ TEST_F(AutofillDialogControllerTest, AutofillProfiles) {
ui::MenuModel* shipping_model =
controller()->MenuModelForSection(SECTION_SHIPPING);
// Since the PersonalDataManager is empty, this should only have the
- // "add new" menu item.
- EXPECT_EQ(1, shipping_model->GetItemCount());
+ // "use billing", "add new" and "manage" menu items.
+ EXPECT_EQ(3, shipping_model->GetItemCount());
EXPECT_CALL(*controller()->GetView(), ModelChanged()).Times(2);
@@ -374,18 +373,21 @@ TEST_F(AutofillDialogControllerTest, AutofillProfiles) {
empty_profile.SetRawInfo(NAME_FULL, ASCIIToUTF16("John Doe"));
controller()->GetTestingManager()->AddTestingProfile(&empty_profile);
shipping_model = controller()->MenuModelForSection(SECTION_SHIPPING);
- EXPECT_EQ(1, shipping_model->GetItemCount());
+ EXPECT_EQ(3, shipping_model->GetItemCount());
// A full profile should be picked up.
AutofillProfile full_profile(test::GetFullProfile());
full_profile.SetRawInfo(ADDRESS_HOME_LINE2, string16());
controller()->GetTestingManager()->AddTestingProfile(&full_profile);
shipping_model = controller()->MenuModelForSection(SECTION_SHIPPING);
- EXPECT_EQ(2, shipping_model->GetItemCount());
+ EXPECT_EQ(4, shipping_model->GetItemCount());
}
TEST_F(AutofillDialogControllerTest, AutofillProfileVariants) {
EXPECT_CALL(*controller()->GetView(), ModelChanged()).Times(1);
+ ui::MenuModel* email_model =
+ controller()->MenuModelForSection(SECTION_EMAIL);
+ EXPECT_EQ(2, email_model->GetItemCount());
// Set up some variant data.
AutofillProfile full_profile(test::GetFullProfile());
@@ -404,10 +406,9 @@ TEST_F(AutofillDialogControllerTest, AutofillProfileVariants) {
controller()->GetTestingManager()->AddTestingProfile(&full_profile);
ui::MenuModel* shipping_model =
controller()->MenuModelForSection(SECTION_SHIPPING);
- EXPECT_EQ(2, shipping_model->GetItemCount());
- ui::MenuModel* email_model =
- controller()->MenuModelForSection(SECTION_EMAIL);
- EXPECT_EQ(3, email_model->GetItemCount());
+ EXPECT_EQ(4, shipping_model->GetItemCount());
+ email_model = controller()->MenuModelForSection(SECTION_EMAIL);
+ EXPECT_EQ(4, email_model->GetItemCount());
email_model->ActivatedAt(0);
EXPECT_EQ(kEmail1,
@@ -496,7 +497,7 @@ TEST_F(AutofillDialogControllerTest, EditClickedCancelled) {
ui::MenuModel* email_model =
controller()->MenuModelForSection(SECTION_EMAIL);
- EXPECT_EQ(2, email_model->GetItemCount());
+ EXPECT_EQ(3, email_model->GetItemCount());
// When unedited, the initial_value should be empty.
email_model->ActivatedAt(0);
« no previous file with comments | « chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc ('k') | chrome/browser/ui/autofill/autofill_dialog_models.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698