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

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

Issue 11636040: AutofillPopupController clarifications + simplifications. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: relative patchset Created 8 years 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_popup_controller_unittest.cc
diff --git a/chrome/browser/ui/autofill/autofill_popup_controller_unittest.cc b/chrome/browser/ui/autofill/autofill_popup_controller_unittest.cc
index efc5e4d2edf5ed3a0f50a59326afbfdaa9aca160..a6421472dd807e2d463391fdc03714805dffc7e2 100644
--- a/chrome/browser/ui/autofill/autofill_popup_controller_unittest.cc
+++ b/chrome/browser/ui/autofill/autofill_popup_controller_unittest.cc
@@ -22,8 +22,7 @@ class MockAutofillExternalDelegate :
MockAutofillExternalDelegate() : TestAutofillExternalDelegate(NULL, NULL) {};
virtual ~MockAutofillExternalDelegate() {};
- virtual void SelectAutofillSuggestionAtIndex(int unique_id)
- OVERRIDE {}
+ virtual void SelectAutofillSuggestion(int unique_id) OVERRIDE {}
virtual void RemoveAutocompleteEntry(const string16& value) OVERRIDE {}
virtual void RemoveAutofillProfileOrCreditCard(int unique_id) OVERRIDE {}
virtual void ClearPreviewedForm() OVERRIDE {}
@@ -39,8 +38,8 @@ class TestAutofillPopupController : public AutofillPopupControllerImpl {
virtual ~TestAutofillPopupController() {}
// Making protected functions public for testing
- const std::vector<string16>& autofill_values() const {
- return AutofillPopupControllerImpl::autofill_values();
+ const std::vector<string16>& labels() const {
+ return AutofillPopupControllerImpl::labels();
}
int selected_line() const {
return AutofillPopupControllerImpl::selected_line();
@@ -107,21 +106,21 @@ TEST_F(AutofillPopupControllerUnitTest, SetBounds) {
TEST_F(AutofillPopupControllerUnitTest, ChangeSelectedLine) {
// Set up the popup.
- std::vector<string16> autofill_values(2, string16());
+ std::vector<string16> labels(2, string16());
std::vector<int> autofill_ids(2, 0);
autofill_popup_controller_->Show(
- autofill_values, autofill_values, autofill_values, autofill_ids);
+ labels, labels, labels, autofill_ids);
Ilya Sherman 2012/12/20 04:34:52 nit: This now fits on the previous line.
Evan Stade 2012/12/20 20:01:25 Done.
EXPECT_LT(autofill_popup_controller_->selected_line(), 0);
// Check that there are at least 2 values so that the first and last selection
// are different.
EXPECT_GE(2,
- static_cast<int>(autofill_popup_controller_->autofill_values().size()));
+ static_cast<int>(autofill_popup_controller_->labels().size()));
// Test wrapping before the front.
autofill_popup_controller_->SelectPreviousLine();
EXPECT_EQ(static_cast<int>(
- autofill_popup_controller_->autofill_values().size() - 1),
+ autofill_popup_controller_->labels().size() - 1),
autofill_popup_controller_->selected_line());
// Test wrapping after the end.
@@ -131,10 +130,10 @@ TEST_F(AutofillPopupControllerUnitTest, ChangeSelectedLine) {
TEST_F(AutofillPopupControllerUnitTest, RedrawSelectedLine) {
// Set up the popup.
- std::vector<string16> autofill_values(2, string16());
+ std::vector<string16> labels(2, string16());
std::vector<int> autofill_ids(2, 0);
autofill_popup_controller_->Show(
- autofill_values, autofill_values, autofill_values,
+ labels, labels, labels,
autofill_ids);
Ilya Sherman 2012/12/20 04:34:52 nit: This now fits on the previous line.
Evan Stade 2012/12/20 20:01:25 Done.
// Make sure that when a new line is selected, it is invalidated so it can
@@ -155,13 +154,13 @@ TEST_F(AutofillPopupControllerUnitTest, RedrawSelectedLine) {
TEST_F(AutofillPopupControllerUnitTest, RemoveLine) {
// Set up the popup.
- std::vector<string16> autofill_values(3, string16());
+ std::vector<string16> labels(3, string16());
std::vector<int> autofill_ids;
autofill_ids.push_back(1);
autofill_ids.push_back(1);
autofill_ids.push_back(WebAutofillClient::MenuItemIDAutofillOptions);
autofill_popup_controller_->Show(
- autofill_values, autofill_values, autofill_values, autofill_ids);
+ labels, labels, labels, autofill_ids);
Ilya Sherman 2012/12/20 04:34:52 nit: This now fits on the previous line.
Evan Stade 2012/12/20 20:01:25 Done.
// Generate a popup, so it can be hidden later. It doesn't matter what the
// external_delegate thinks is being shown in the process, since we are just
@@ -173,7 +172,7 @@ TEST_F(AutofillPopupControllerUnitTest, RemoveLine) {
// Try to remove the last entry and ensure it fails (it is an option).
autofill_popup_controller_->SetSelectedLine(
- autofill_popup_controller_->autofill_values().size() - 1);
+ autofill_popup_controller_->labels().size() - 1);
EXPECT_FALSE(autofill_popup_controller_->RemoveSelectedLine());
EXPECT_LE(0, autofill_popup_controller_->selected_line());
@@ -195,13 +194,13 @@ TEST_F(AutofillPopupControllerUnitTest, RemoveLine) {
TEST_F(AutofillPopupControllerUnitTest, SkipSeparator) {
// Set up the popup.
- std::vector<string16> autofill_values(3, string16());
+ std::vector<string16> labels(3, string16());
std::vector<int> autofill_ids;
autofill_ids.push_back(1);
autofill_ids.push_back(WebAutofillClient::MenuItemIDSeparator);
autofill_ids.push_back(WebAutofillClient::MenuItemIDAutofillOptions);
autofill_popup_controller_->Show(
- autofill_values, autofill_values, autofill_values, autofill_ids);
+ labels, labels, labels, autofill_ids);
Ilya Sherman 2012/12/20 04:34:52 nit: This now fits on the previous line.
Evan Stade 2012/12/20 20:01:25 Done.
autofill_popup_controller_->SetSelectedLine(0);

Powered by Google App Engine
This is Rietveld 408576698