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

Unified Diff: ash/wm/overview/window_selector_unittest.cc

Issue 324493004: Fix pressing enter key crashes overview mode without a selection. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed Rob's comments, test failing. Created 6 years, 6 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 | « ash/wm/overview/window_selector.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/overview/window_selector_unittest.cc
diff --git a/ash/wm/overview/window_selector_unittest.cc b/ash/wm/overview/window_selector_unittest.cc
index 01fad7d9c29807220146439f26ce8a2b4e914de5..57b220a0feb38d2c33815c083227c7cc9f49ea88 100644
--- a/ash/wm/overview/window_selector_unittest.cc
+++ b/ash/wm/overview/window_selector_unittest.cc
@@ -861,4 +861,30 @@ TEST_F(WindowSelectorTest, BasicMultiMonitorArrowKeyNavigation) {
EXPECT_EQ(GetSelectedWindow(), window4.get());
}
+// Tests selecting a window in overview mode with the return key.
+TEST_F(WindowSelectorTest, SelectWindowWithReturnKey) {
+ gfx::Rect bounds(0, 0, 100, 100);
+ scoped_ptr<aura::Window> window2(CreateWindow(bounds));
+ scoped_ptr<aura::Window> window1(CreateWindow(bounds));
+ ToggleOverview();
+
+ // Pressing the return key without a selection widget should not do anything.
+ SendKey(ui::VKEY_RETURN);
+ EXPECT_TRUE(IsSelecting());
+
+ // Select the first window.
+ SendKey(ui::VKEY_RIGHT);
+ SendKey(ui::VKEY_RETURN);
+ ASSERT_FALSE(IsSelecting());
+ EXPECT_TRUE(wm::IsActiveWindow(window1.get()));
+
+ // Select the second window.
+ ToggleOverview();
+ SendKey(ui::VKEY_RIGHT);
+ SendKey(ui::VKEY_RIGHT);
+ SendKey(ui::VKEY_RETURN);
+ EXPECT_FALSE(IsSelecting());
+ EXPECT_TRUE(wm::IsActiveWindow(window2.get()));
+}
+
} // namespace ash
« no previous file with comments | « ash/wm/overview/window_selector.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698