OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ash/accessibility_delegate.h" | 5 #include "ash/accessibility_delegate.h" |
6 #include "ash/drag_drop/drag_drop_controller.h" | 6 #include "ash/drag_drop/drag_drop_controller.h" |
7 #include "ash/root_window_controller.h" | 7 #include "ash/root_window_controller.h" |
8 #include "ash/screen_util.h" | 8 #include "ash/screen_util.h" |
9 #include "ash/shelf/shelf.h" | 9 #include "ash/shelf/shelf.h" |
10 #include "ash/shelf/shelf_widget.h" | 10 #include "ash/shelf/shelf_widget.h" |
(...skipping 843 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
854 SendKey(ui::VKEY_RIGHT); | 854 SendKey(ui::VKEY_RIGHT); |
855 EXPECT_EQ(GetSelectedWindow(), window1.get()); | 855 EXPECT_EQ(GetSelectedWindow(), window1.get()); |
856 SendKey(ui::VKEY_RIGHT); | 856 SendKey(ui::VKEY_RIGHT); |
857 EXPECT_EQ(GetSelectedWindow(), window2.get()); | 857 EXPECT_EQ(GetSelectedWindow(), window2.get()); |
858 SendKey(ui::VKEY_RIGHT); | 858 SendKey(ui::VKEY_RIGHT); |
859 EXPECT_EQ(GetSelectedWindow(), window3.get()); | 859 EXPECT_EQ(GetSelectedWindow(), window3.get()); |
860 SendKey(ui::VKEY_RIGHT); | 860 SendKey(ui::VKEY_RIGHT); |
861 EXPECT_EQ(GetSelectedWindow(), window4.get()); | 861 EXPECT_EQ(GetSelectedWindow(), window4.get()); |
862 } | 862 } |
863 | 863 |
| 864 // Tests selecting a window in overview mode with the return key. |
| 865 TEST_F(WindowSelectorTest, SelectWindowWithReturnKey) { |
| 866 gfx::Rect bounds(0, 0, 100, 100); |
| 867 scoped_ptr<aura::Window> window2(CreateWindow(bounds)); |
| 868 scoped_ptr<aura::Window> window1(CreateWindow(bounds)); |
| 869 ToggleOverview(); |
| 870 |
| 871 // Pressing the return key without a selection widget should not do anything. |
| 872 SendKey(ui::VKEY_RETURN); |
| 873 EXPECT_TRUE(IsSelecting()); |
| 874 |
| 875 // Select the first window. |
| 876 SendKey(ui::VKEY_RIGHT); |
| 877 SendKey(ui::VKEY_RETURN); |
| 878 ASSERT_FALSE(IsSelecting()); |
| 879 EXPECT_TRUE(wm::IsActiveWindow(window1.get())); |
| 880 |
| 881 // Select the second window. |
| 882 ToggleOverview(); |
| 883 SendKey(ui::VKEY_RIGHT); |
| 884 SendKey(ui::VKEY_RIGHT); |
| 885 SendKey(ui::VKEY_RETURN); |
| 886 EXPECT_FALSE(IsSelecting()); |
| 887 EXPECT_TRUE(wm::IsActiveWindow(window2.get())); |
| 888 } |
| 889 |
864 } // namespace ash | 890 } // namespace ash |
OLD | NEW |