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 b6bf3e49d4acf780bef34efbeeb6f448167889a6..408d3fecce1dda0c278a51a1b7392e77d02b2710 100644 |
--- a/chrome/browser/ui/autofill/autofill_dialog_controller_unittest.cc |
+++ b/chrome/browser/ui/autofill/autofill_dialog_controller_unittest.cc |
@@ -308,6 +308,19 @@ class AutofillDialogControllerTest : public testing::Test { |
test_web_contents_.reset( |
content::WebContentsTester::CreateTestWebContents(profile(), NULL)); |
+ SetUpControllerWithFormData(form_data); |
+ } |
+ |
+ virtual void TearDown() OVERRIDE { |
+ if (controller_) |
+ controller_->ViewClosed(); |
+ } |
+ |
+ protected: |
+ void SetUpControllerWithFormData(const FormData& form_data) { |
+ if (controller_) |
+ controller_->ViewClosed(); |
+ |
base::Callback<void(const FormStructure*, const std::string&)> callback = |
base::Bind(&AutofillDialogControllerTest::FinishedCallback, |
base::Unretained(this)); |
@@ -323,12 +336,6 @@ class AutofillDialogControllerTest : public testing::Test { |
controller_->OnUserNameFetchSuccess(kFakeEmail); |
} |
- virtual void TearDown() OVERRIDE { |
- if (controller_) |
- controller_->ViewClosed(); |
- } |
- |
- protected: |
void FillCreditCardInputs() { |
DetailOutputMap cc_outputs; |
const DetailInputs& cc_inputs = |
@@ -720,6 +727,41 @@ TEST_F(AutofillDialogControllerTest, UseBillingAsShipping) { |
EXPECT_EQ(ADDRESS_HOME_STATE, form_structure()->field(3)->type()); |
} |
+// Tests that shipping and billing telephone fields are supported, and filled |
+// in by their respective profiles. http://crbug.com/244515 |
+TEST_F(AutofillDialogControllerTest, DISABLED_BillingVsShippingPhoneNumber) { |
+ FormFieldData shipping_tel; |
+ shipping_tel.autocomplete_attribute = "shipping tel"; |
+ FormFieldData billing_tel; |
+ billing_tel.autocomplete_attribute = "billing tel"; |
+ |
+ FormData form_data; |
+ form_data.fields.push_back(shipping_tel); |
+ form_data.fields.push_back(billing_tel); |
+ SetUpControllerWithFormData(form_data); |
+ |
+ AutofillProfile full_profile(test::GetVerifiedProfile()); |
+ AutofillProfile full_profile2(test::GetVerifiedProfile2()); |
Dan Beam
2013/05/28 19:17:49
can you use {shipping,billing}_profile so it's mor
Evan Stade
2013/05/28 19:30:09
Done.
|
+ CreditCard credit_card(test::GetVerifiedCreditCard()); |
+ controller()->GetTestingManager()->AddTestingProfile(&full_profile); |
+ controller()->GetTestingManager()->AddTestingProfile(&full_profile2); |
+ controller()->GetTestingManager()->AddTestingCreditCard(&credit_card); |
+ ui::MenuModel* billing_model = |
+ controller()->MenuModelForSection(SECTION_BILLING); |
+ billing_model->ActivatedAt(1); |
+ |
+ controller()->OnAccept(); |
+ ASSERT_EQ(2U, form_structure()->field_count()); |
+ EXPECT_EQ(PHONE_HOME_WHOLE_NUMBER, form_structure()->field(0)->type()); |
+ EXPECT_EQ(PHONE_HOME_WHOLE_NUMBER, form_structure()->field(1)->type()); |
+ EXPECT_EQ(full_profile.GetRawInfo(PHONE_HOME_WHOLE_NUMBER), |
+ form_structure()->field(0)->value); |
+ EXPECT_EQ(full_profile2.GetRawInfo(PHONE_HOME_WHOLE_NUMBER), |
+ form_structure()->field(1)->value); |
+ EXPECT_NE(form_structure()->field(1)->value, |
+ form_structure()->field(0)->value); |
+} |
+ |
TEST_F(AutofillDialogControllerTest, AcceptLegalDocuments) { |
EXPECT_CALL(*controller()->GetTestingWalletClient(), |
AcceptLegalDocuments(_, _, _)).Times(1); |