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

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

Issue 1059903002: Allow Alt-Tab to move the focus to docked windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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_controller.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 5ebf669077064d5b40f97a806f80b6eb7f235eaf..3ae60cc9458fe43d0e98bf248766d50a35c5a3ed 100644
--- a/ash/wm/overview/window_selector_unittest.cc
+++ b/ash/wm/overview/window_selector_unittest.cc
@@ -286,6 +286,7 @@ TEST_F(WindowSelectorTest, Basic) {
scoped_ptr<aura::Window> window2(CreateWindow(bounds));
scoped_ptr<aura::Window> panel1(CreatePanelWindow(bounds));
scoped_ptr<aura::Window> panel2(CreatePanelWindow(bounds));
+
EXPECT_TRUE(WindowsOverlapping(window1.get(), window2.get()));
EXPECT_TRUE(WindowsOverlapping(panel1.get(), panel2.get()));
wm::ActivateWindow(window2.get());
@@ -313,6 +314,50 @@ TEST_F(WindowSelectorTest, Basic) {
EXPECT_FALSE(aura::client::GetCursorClient(root_window)->IsCursorLocked());
}
+// Tests entering overview mode with docked windows
+TEST_F(WindowSelectorTest, BasicWithDocked) {
+ // aura::Window* root_window = Shell::GetPrimaryRootWindow();
+ gfx::Rect bounds(300, 0, 200, 200);
+ scoped_ptr<aura::Window> window1(CreateWindow(bounds));
+ scoped_ptr<aura::Window> window2(CreateWindow(bounds));
+ scoped_ptr<aura::Window> docked1(CreateWindow(bounds));
+ scoped_ptr<aura::Window> docked2(CreateWindow(bounds));
+
+ wm::WMEvent dock_event(wm::WM_EVENT_DOCK);
+ wm::GetWindowState(docked1.get())->OnWMEvent(&dock_event);
+
+ wm::WindowState* docked_state2 = wm::GetWindowState(docked2.get());
+ docked_state2->OnWMEvent(&dock_event);
+ wm::WMEvent minimize_event(wm::WM_EVENT_MINIMIZE);
+ docked_state2->OnWMEvent(&minimize_event);
+
+ EXPECT_TRUE(WindowsOverlapping(window1.get(), window2.get()));
+ gfx::Rect docked_bounds = docked1->GetBoundsInScreen();
+
+ EXPECT_NE(bounds.ToString(), docked_bounds.ToString());
+ EXPECT_FALSE(WindowsOverlapping(window1.get(), docked1.get()));
+ EXPECT_FALSE(WindowsOverlapping(window1.get(), docked2.get()));
+ EXPECT_FALSE(docked2->IsVisible());
+
+ EXPECT_EQ(wm::WINDOW_STATE_TYPE_DOCKED,
+ wm::GetWindowState(docked1.get())->GetStateType());
+ EXPECT_EQ(wm::WINDOW_STATE_TYPE_DOCKED_MINIMIZED,
+ wm::GetWindowState(docked2.get())->GetStateType());
+
+ ToggleOverview();
+
+ EXPECT_FALSE(WindowsOverlapping(window1.get(), window2.get()));
+ // Docked windows stays the same.
+ EXPECT_EQ(docked_bounds.ToString(), docked1->GetBoundsInScreen().ToString());
+ EXPECT_FALSE(docked2->IsVisible());
+
+ // Docked window can still be activated, which will exit the overview mode.
+ ClickWindow(docked1.get());
+ EXPECT_TRUE(wm::IsActiveWindow(docked1.get()));
+ EXPECT_FALSE(
+ ash::Shell::GetInstance()->window_selector_controller()->IsSelecting());
+}
+
// Tests selecting a window by tapping on it.
TEST_F(WindowSelectorTest, BasicGesture) {
gfx::Rect bounds(0, 0, 400, 400);
@@ -710,29 +755,6 @@ TEST_F(WindowSelectorTest, QuickReentryRestoresInitialTransform) {
GetTransformedTargetBounds(window.get())));
}
-// Tests that non-activatable windows are hidden when entering overview mode.
-TEST_F(WindowSelectorTest, NonActivatableWindowsHidden) {
- gfx::Rect bounds(0, 0, 400, 400);
- scoped_ptr<aura::Window> window1(CreateWindow(bounds));
- scoped_ptr<aura::Window> window2(CreateWindow(bounds));
- scoped_ptr<aura::Window> non_activatable_window(
- CreateNonActivatableWindow(Shell::GetPrimaryRootWindow()->bounds()));
- EXPECT_TRUE(non_activatable_window->IsVisible());
- ToggleOverview();
- EXPECT_FALSE(non_activatable_window->IsVisible());
- ToggleOverview();
- EXPECT_TRUE(non_activatable_window->IsVisible());
-
- // Test that a window behind the fullscreen non-activatable window can be
- // clicked.
- non_activatable_window->parent()->StackChildAtTop(
- non_activatable_window.get());
- ToggleOverview();
- ClickWindow(window1.get());
- EXPECT_FALSE(IsSelecting());
- EXPECT_TRUE(wm::IsActiveWindow(window1.get()));
-}
-
// Tests that windows with modal child windows are transformed with the modal
// child even though not activatable themselves.
TEST_F(WindowSelectorTest, ModalChild) {
« no previous file with comments | « ash/wm/overview/window_selector_controller.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698