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

Unified Diff: ui/views/controls/combobox/combobox_unittest.cc

Issue 2299023003: Activate comboboxes (i.e. open dropdown menu) on Enter and Space. (Closed)
Patch Set: Created 4 years, 4 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 | « ui/views/controls/combobox/combobox.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/combobox/combobox_unittest.cc
diff --git a/ui/views/controls/combobox/combobox_unittest.cc b/ui/views/controls/combobox/combobox_unittest.cc
index ea81193011ccb0beb9a4859d28330f18067974fe..ec9ade9b90c92c562058c2fba6eda61cd649d1a8 100644
--- a/ui/views/controls/combobox/combobox_unittest.cc
+++ b/ui/views/controls/combobox/combobox_unittest.cc
@@ -626,10 +626,14 @@ TEST_F(ComboboxTest, NotifyOnClickWithMouse) {
TEST_F(ComboboxTest, ConsumingPressKeyEvents) {
InitCombobox(nullptr, Combobox::STYLE_NORMAL);
- EXPECT_FALSE(combobox_->OnKeyPressed(
+ int menu_show_count = 0;
+ test_api_->InstallTestMenuRunner(&menu_show_count);
+ EXPECT_TRUE(combobox_->OnKeyPressed(
ui::KeyEvent(ui::ET_KEY_PRESSED, ui::VKEY_RETURN, ui::EF_NONE)));
- EXPECT_FALSE(combobox_->OnKeyPressed(
+ EXPECT_EQ(1, menu_show_count);
+ EXPECT_TRUE(combobox_->OnKeyPressed(
ui::KeyEvent(ui::ET_KEY_PRESSED, ui::VKEY_SPACE, ui::EF_NONE)));
+ EXPECT_EQ(2, menu_show_count);
}
TEST_F(ComboboxTest, ConsumingKeyPressEventsActionStyle) {
« no previous file with comments | « ui/views/controls/combobox/combobox.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698