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

Unified Diff: chrome/browser/autofill/autofill_popup_unittest.cc

Issue 11189093: Skip Unacceptable Items in new Autofill UI when Navigating with Keys. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 2 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
« no previous file with comments | « no previous file | chrome/browser/autofill/autofill_popup_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autofill/autofill_popup_unittest.cc
diff --git a/chrome/browser/autofill/autofill_popup_unittest.cc b/chrome/browser/autofill/autofill_popup_unittest.cc
index ea3a97281570a22b9a69102b1096ddcf1cf90822..267a8a22fbd9d0a34b96dc963d67a183374c9bb0 100644
--- a/chrome/browser/autofill/autofill_popup_unittest.cc
+++ b/chrome/browser/autofill/autofill_popup_unittest.cc
@@ -153,3 +153,27 @@ TEST_F(AutofillPopupViewUnitTest, RemoveLine) {
autofill_popup_view_->SetSelectedLine(0);
EXPECT_TRUE(autofill_popup_view_->RemoveSelectedLine());
}
+
+TEST_F(AutofillPopupViewUnitTest, SkipSeparator) {
+ // Set up the popup.
+ std::vector<string16> autofill_values(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_view_->Show(autofill_values, autofill_values, autofill_values,
+ autofill_ids);
+
+ // To remove warnings.
+ EXPECT_CALL(*autofill_popup_view_, InvalidateRow(_)).Times(AtLeast(0));
+
+ autofill_popup_view_->SetSelectedLine(0);
+
+ // Make sure next skips the unselectable separator.
+ autofill_popup_view_->SelectNextLine();
+ EXPECT_EQ(2, autofill_popup_view_->selected_line());
+
+ // Make sure previous skips the unselectable separator.
+ autofill_popup_view_->SelectPreviousLine();
+ EXPECT_EQ(0, autofill_popup_view_->selected_line());
+}
« no previous file with comments | « no previous file | chrome/browser/autofill/autofill_popup_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698