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

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

Issue 14821005: [RFP, Autofill] Switching dialog field identification to int. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
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_browsertest.cc
diff --git a/chrome/browser/ui/autofill/autofill_dialog_controller_browsertest.cc b/chrome/browser/ui/autofill/autofill_dialog_controller_browsertest.cc
index 90eaf445b3cef832ac978f57ce273483cd05d398..b490215489b7881d79d37b2d8fd7dae0599c4634 100644
--- a/chrome/browser/ui/autofill/autofill_dialog_controller_browsertest.cc
+++ b/chrome/browser/ui/autofill/autofill_dialog_controller_browsertest.cc
@@ -111,8 +111,8 @@ class TestAutofillDialogController : public AutofillDialogControllerImpl {
// Increase visibility for testing.
AutofillDialogView* view() { return AutofillDialogControllerImpl::view(); }
- const DetailInput* input_showing_popup() const {
- return AutofillDialogControllerImpl::input_showing_popup();
+ const AutofillFieldType input_showing_popup_type() const {
+ return AutofillDialogControllerImpl::input_showing_popup_type();
}
TestPersonalDataManager* GetTestingManager() {
@@ -265,44 +265,45 @@ IN_PROC_BROWSER_TEST_F(AutofillDialogControllerTest, FillInputFromAutofill) {
const DetailInputs& inputs =
controller()->RequestedFieldsForSection(SECTION_SHIPPING);
- const DetailInput& triggering_input = inputs[0];
- string16 value = full_profile.GetRawInfo(triggering_input.type);
+ AutofillFieldType triggering_input = inputs[0].type;
+ string16 value = full_profile.GetRawInfo(triggering_input);
TestableAutofillDialogView* view = controller()->view()->GetTestableView();
- view->SetTextContentsOfInput(triggering_input,
- value.substr(0, value.size() / 2));
- view->ActivateInput(triggering_input);
+ view->SetTextContentsOfInput(
+ SECTION_SHIPPING, triggering_input, value.substr(0, value.size() / 2));
+ view->ActivateInput(SECTION_SHIPPING, triggering_input);
- ASSERT_EQ(&triggering_input, controller()->input_showing_popup());
+ ASSERT_EQ(triggering_input, controller()->input_showing_popup_type());
controller()->DidAcceptSuggestion(string16(), 0);
// All inputs should be filled.
AutofillProfileWrapper wrapper(&full_profile, 0);
for (size_t i = 0; i < inputs.size(); ++i) {
EXPECT_EQ(wrapper.GetInfo(inputs[i].type),
- view->GetTextContentsOfInput(inputs[i]));
+ view->GetTextContentsOfInput(SECTION_SHIPPING, inputs[i].type));
}
// Now simulate some user edits and try again.
std::vector<string16> expectations;
for (size_t i = 0; i < inputs.size(); ++i) {
string16 users_input = i % 2 == 0 ? string16() : ASCIIToUTF16("dummy");
- view->SetTextContentsOfInput(inputs[i], users_input);
+ view->SetTextContentsOfInput(SECTION_SHIPPING, inputs[i].type, users_input);
// Empty inputs should be filled, others should be left alone.
string16 expectation =
- &inputs[i] == &triggering_input || users_input.empty() ?
- wrapper.GetInfo(inputs[i].type) :
- users_input;
+ inputs[i].type == triggering_input || users_input.empty()
+ ? wrapper.GetInfo(inputs[i].type)
+ : users_input;
expectations.push_back(expectation);
}
- view->SetTextContentsOfInput(triggering_input,
- value.substr(0, value.size() / 2));
- view->ActivateInput(triggering_input);
- ASSERT_EQ(&triggering_input, controller()->input_showing_popup());
+ view->SetTextContentsOfInput(
+ SECTION_SHIPPING, triggering_input, value.substr(0, value.size() / 2));
+ view->ActivateInput(SECTION_SHIPPING, triggering_input);
+ ASSERT_EQ(triggering_input, controller()->input_showing_popup_type());
controller()->DidAcceptSuggestion(string16(), 0);
for (size_t i = 0; i < inputs.size(); ++i) {
- EXPECT_EQ(expectations[i], view->GetTextContentsOfInput(inputs[i]));
+ EXPECT_EQ(expectations[i],
+ view->GetTextContentsOfInput(SECTION_SHIPPING, inputs[i].type));
}
}
#endif // defined(TOOLKIT_VIEWS)
« no previous file with comments | « chrome/browser/ui/autofill/autofill_dialog_controller.h ('k') | chrome/browser/ui/autofill/autofill_dialog_controller_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698