Chromium Code Reviews| 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..8b223968d54626f647cb71d857126d5217ca9973 100644 |
| --- a/ash/wm/overview/window_selector_unittest.cc |
| +++ b/ash/wm/overview/window_selector_unittest.cc |
| @@ -861,4 +861,29 @@ 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 bounds1(0, 0, 100, 100); |
|
tdanderson
2014/06/06 21:15:18
nit: bounds, not bounds1.
Nina
2014/06/06 21:44:32
Done.
|
| + scoped_ptr<aura::Window> window2(CreateWindow(bounds1)); |
|
tdanderson
2014/06/06 21:15:18
nit: declare window1 before window2
Nina
2014/06/06 21:44:32
The reason the declaration is in that order is so
|
| + scoped_ptr<aura::Window> window1(CreateWindow(bounds1)); |
| + 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()); |
|
tdanderson
2014/06/06 21:15:17
EXPECT_FALSE? (ASSERT_FALSE will crash the test at
Nina
2014/06/06 21:44:32
I want the test to stop if that fails as the outco
|
| + EXPECT_TRUE(wm::IsActiveWindow(window1.get())); |
| + |
| + // Select the second window. |
| + ToggleOverview(); |
| + SendKey(ui::VKEY_RIGHT); |
| + SendKey(ui::VKEY_RIGHT); |
| + SendKey(ui::VKEY_RETURN); |
| + EXPECT_TRUE(wm::IsActiveWindow(window2.get())); |
|
tdanderson
2014/06/06 21:15:17
Can you also add an EXPECT for IsSelecting() here
Nina
2014/06/06 21:44:32
Sure.
|
| +} |
| + |
| } // namespace ash |