Commit 6ce0bbc6 authored by estade@chromium.org's avatar estade@chromium.org

add a regression test for requestAutocomplete

test is disabled because it will fail until the bug is fixed

BUG=244515

Review URL: https://chromiumcodereview.appspot.com/16096007

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@202757 0039d316-1c4b-4281-b951-d872f2087c98
parent a481f672
...@@ -308,6 +308,19 @@ class AutofillDialogControllerTest : public testing::Test { ...@@ -308,6 +308,19 @@ class AutofillDialogControllerTest : public testing::Test {
test_web_contents_.reset( test_web_contents_.reset(
content::WebContentsTester::CreateTestWebContents(profile(), NULL)); 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::Callback<void(const FormStructure*, const std::string&)> callback =
base::Bind(&AutofillDialogControllerTest::FinishedCallback, base::Bind(&AutofillDialogControllerTest::FinishedCallback,
base::Unretained(this)); base::Unretained(this));
...@@ -323,12 +336,6 @@ class AutofillDialogControllerTest : public testing::Test { ...@@ -323,12 +336,6 @@ class AutofillDialogControllerTest : public testing::Test {
controller_->OnUserNameFetchSuccess(kFakeEmail); controller_->OnUserNameFetchSuccess(kFakeEmail);
} }
virtual void TearDown() OVERRIDE {
if (controller_)
controller_->ViewClosed();
}
protected:
void FillCreditCardInputs() { void FillCreditCardInputs() {
DetailOutputMap cc_outputs; DetailOutputMap cc_outputs;
const DetailInputs& cc_inputs = const DetailInputs& cc_inputs =
...@@ -813,6 +820,43 @@ TEST_F(AutofillDialogControllerTest, UseBillingAsShipping) { ...@@ -813,6 +820,43 @@ TEST_F(AutofillDialogControllerTest, UseBillingAsShipping) {
EXPECT_EQ(ADDRESS_HOME_STATE, form_structure()->field(3)->type()); 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);
// The profile that will be chosen for the shipping section.
AutofillProfile shipping_profile(test::GetVerifiedProfile());
// The profile that will be chosen for the billing section.
AutofillProfile billing_profile(test::GetVerifiedProfile2());
CreditCard credit_card(test::GetVerifiedCreditCard());
controller()->GetTestingManager()->AddTestingProfile(&shipping_profile);
controller()->GetTestingManager()->AddTestingProfile(&billing_profile);
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(shipping_profile.GetRawInfo(PHONE_HOME_WHOLE_NUMBER),
form_structure()->field(0)->value);
EXPECT_EQ(billing_profile.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) { TEST_F(AutofillDialogControllerTest, AcceptLegalDocuments) {
EXPECT_CALL(*controller()->GetTestingWalletClient(), EXPECT_CALL(*controller()->GetTestingWalletClient(),
AcceptLegalDocuments(_, _, _)).Times(1); AcceptLegalDocuments(_, _, _)).Times(1);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment