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 028bacd816856a72a8bc493ee611552cef90ea8f..1d7b49bfab29b7cfb6d6bd453b2beeca526f1b15 100644 |
| --- a/ash/wm/overview/window_selector_unittest.cc |
| +++ b/ash/wm/overview/window_selector_unittest.cc |
| @@ -155,16 +155,6 @@ class WindowSelectorTest : public test::AshTestBase { |
| ash::Shell::GetInstance()->window_selector_controller()->ToggleOverview(); |
| } |
| - void Cycle(WindowSelector::Direction direction) { |
| - ash::Shell::GetInstance()->window_selector_controller()-> |
| - HandleCycleWindow(direction); |
| - } |
| - |
| - void StopCycling() { |
| - ash::Shell::GetInstance()->window_selector_controller()->window_selector_-> |
| - SelectWindow(); |
| - } |
| - |
| void FireOverviewStartTimer() { |
| // Calls the method to start overview mode which is normally called by the |
| // timer. The timer will still fire and call this method triggering the |
| @@ -328,16 +318,6 @@ TEST_F(WindowSelectorTest, FullscreenWindow) { |
| ToggleOverview(); |
| ClickWindow(window2.get()); |
| EXPECT_TRUE(wm::GetWindowState(window1.get())->IsFullscreen()); |
| - |
| - // Verify that selecting the panel will make it visible. |
| - // TODO(flackr): Click on panel rather than cycle to it when |
| - // clicking on panels is fixed, see http://crbug.com/339834. |
| - Cycle(WindowSelector::FORWARD); |
| - Cycle(WindowSelector::FORWARD); |
| - StopCycling(); |
| - EXPECT_TRUE(wm::GetWindowState(panel1.get())->IsActive()); |
| - EXPECT_TRUE(wm::GetWindowState(window1.get())->IsFullscreen()); |
| - EXPECT_TRUE(panel1->IsVisible()); |
| } |
| // Tests that the shelf dimming state is removed while in overview and restored |
| @@ -365,18 +345,6 @@ TEST_F(WindowSelectorTest, SelectingHidesAppList) { |
| ToggleOverview(); |
| EXPECT_FALSE(Shell::GetInstance()->GetAppListTargetVisibility()); |
| ToggleOverview(); |
| - |
| - // The app list uses an animation to fade out. If it is toggled on immediately |
| - // after being removed the old widget is re-used and it does not gain focus. |
| - // When running under normal circumstances this shouldn't be possible, but |
| - // it is in a test without letting the message loop run. |
| - RunAllPendingInMessageLoop(); |
| - |
| - Shell::GetInstance()->ToggleAppList(NULL); |
| - EXPECT_TRUE(Shell::GetInstance()->GetAppListTargetVisibility()); |
| - Cycle(WindowSelector::FORWARD); |
| - EXPECT_FALSE(Shell::GetInstance()->GetAppListTargetVisibility()); |
| - StopCycling(); |
| } |
| // Tests that a minimized window's visibility and layer visibility is correctly |
| @@ -420,129 +388,7 @@ TEST_F(WindowSelectorTest, BoundsChangeDuringOverview) { |
| ToggleOverview(); |
| } |
| -// Tests entering overview mode with three windows and cycling through them. |
| -TEST_F(WindowSelectorTest, BasicCycle) { |
| - 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> window3(CreateWindow(bounds)); |
| - wm::ActivateWindow(window3.get()); |
| - wm::ActivateWindow(window2.get()); |
| - wm::ActivateWindow(window1.get()); |
| - EXPECT_TRUE(wm::IsActiveWindow(window1.get())); |
| - EXPECT_FALSE(wm::IsActiveWindow(window2.get())); |
| - EXPECT_FALSE(wm::IsActiveWindow(window3.get())); |
| - |
| - Cycle(WindowSelector::FORWARD); |
| - EXPECT_TRUE(IsSelecting()); |
| - EXPECT_TRUE(wm::IsActiveWindow(window2.get())); |
| - |
| - Cycle(WindowSelector::FORWARD); |
| - EXPECT_TRUE(wm::IsActiveWindow(window3.get())); |
| - |
| - StopCycling(); |
| - EXPECT_FALSE(IsSelecting()); |
| - EXPECT_FALSE(wm::IsActiveWindow(window1.get())); |
| - EXPECT_FALSE(wm::IsActiveWindow(window2.get())); |
| - EXPECT_TRUE(wm::IsActiveWindow(window3.get())); |
| -} |
| - |
| -// Tests that cycling through windows preserves the window stacking order. |
| -TEST_F(WindowSelectorTest, CyclePreservesStackingOrder) { |
| - 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> window3(CreateWindow(bounds)); |
| - wm::ActivateWindow(window3.get()); |
| - wm::ActivateWindow(window2.get()); |
| - wm::ActivateWindow(window1.get()); |
| - // Window order from top to bottom is 1, 2, 3. |
| - EXPECT_TRUE(IsWindowAbove(window1.get(), window2.get())); |
| - EXPECT_TRUE(IsWindowAbove(window2.get(), window3.get())); |
| - |
| - // On window 2. |
| - Cycle(WindowSelector::FORWARD); |
| - EXPECT_TRUE(IsWindowAbove(window2.get(), window1.get())); |
| - EXPECT_TRUE(IsWindowAbove(window1.get(), window3.get())); |
| - |
| - // On window 3. |
| - Cycle(WindowSelector::FORWARD); |
| - EXPECT_TRUE(IsWindowAbove(window3.get(), window1.get())); |
| - EXPECT_TRUE(IsWindowAbove(window1.get(), window2.get())); |
| - |
| - // Back on window 1. |
| - Cycle(WindowSelector::FORWARD); |
| - EXPECT_TRUE(IsWindowAbove(window1.get(), window2.get())); |
| - EXPECT_TRUE(IsWindowAbove(window2.get(), window3.get())); |
| - StopCycling(); |
| -} |
| - |
| -// Tests that cycling through windows shows and minimizes windows as they |
| -// are passed. |
| -TEST_F(WindowSelectorTest, CyclePreservesMinimization) { |
| - gfx::Rect bounds(0, 0, 400, 400); |
| - scoped_ptr<aura::Window> window1(CreateWindow(bounds)); |
| - scoped_ptr<aura::Window> window2(CreateWindow(bounds)); |
| - wm::ActivateWindow(window2.get()); |
| - wm::GetWindowState(window2.get())->Minimize(); |
| - wm::ActivateWindow(window1.get()); |
| - EXPECT_TRUE(wm::IsWindowMinimized(window2.get())); |
| - |
| - // On window 2. |
| - Cycle(WindowSelector::FORWARD); |
| - EXPECT_FALSE(wm::IsWindowMinimized(window2.get())); |
| - |
| - // Back on window 1. |
| - Cycle(WindowSelector::FORWARD); |
| - EXPECT_TRUE(wm::IsWindowMinimized(window2.get())); |
| - |
| - StopCycling(); |
| - EXPECT_TRUE(wm::IsWindowMinimized(window2.get())); |
| -} |
| - |
| -// Tests beginning cycling while in overview mode. |
| -TEST_F(WindowSelectorTest, OverviewTransitionToCycle) { |
| - gfx::Rect bounds(0, 0, 400, 400); |
| - scoped_ptr<aura::Window> window1(CreateWindow(bounds)); |
| - scoped_ptr<aura::Window> window2(CreateWindow(bounds)); |
| - wm::ActivateWindow(window2.get()); |
| - wm::ActivateWindow(window1.get()); |
| - |
| - ToggleOverview(); |
| - Cycle(WindowSelector::FORWARD); |
| - StopCycling(); |
| - |
| - EXPECT_TRUE(wm::IsActiveWindow(window2.get())); |
| - EXPECT_FALSE(wm::IsActiveWindow(window1.get())); |
| - EXPECT_EQ(window2.get(), GetFocusedWindow()); |
| -} |
| - |
| -// Tests cycles between panel and normal windows. |
| -TEST_F(WindowSelectorTest, CyclePanels) { |
| - 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> panel1(CreatePanelWindow(bounds)); |
| - scoped_ptr<aura::Window> panel2(CreatePanelWindow(bounds)); |
| - wm::ActivateWindow(window2.get()); |
| - wm::ActivateWindow(window1.get()); |
| - wm::ActivateWindow(panel2.get()); |
| - wm::ActivateWindow(panel1.get()); |
| - EXPECT_TRUE(wm::IsActiveWindow(panel1.get())); |
| - |
| - // Cycling once should select window1 since the panels are grouped into a |
| - // single selectable item. |
| - Cycle(WindowSelector::FORWARD); |
| - StopCycling(); |
| - EXPECT_TRUE(wm::IsActiveWindow(window1.get())); |
| - |
| - // Cycling again should select the most recently used panel. |
| - Cycle(WindowSelector::FORWARD); |
| - StopCycling(); |
| - EXPECT_TRUE(wm::IsActiveWindow(panel1.get())); |
| -} |
| - |
| -// Tests the visibility of panel windows during cycling. |
| +/*// Tests the visibility of panel windows during cycling. |
| TEST_F(WindowSelectorTest, CyclePanelVisibility) { |
| gfx::Rect bounds(0, 0, 400, 400); |
| scoped_ptr<aura::Window> window1(CreateWindow(bounds)); |
| @@ -554,57 +400,7 @@ TEST_F(WindowSelectorTest, CyclePanelVisibility) { |
| FireOverviewStartTimer(); |
| EXPECT_EQ(1.0f, panel1->layer()->GetTargetOpacity()); |
| StopCycling(); |
| -} |
| - |
| -// Tests cycles between panel and normal windows. |
| -TEST_F(WindowSelectorTest, CyclePanelsDestroyed) { |
| - 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> window3(CreateWindow(bounds)); |
| - scoped_ptr<aura::Window> panel1(CreatePanelWindow(bounds)); |
| - scoped_ptr<aura::Window> panel2(CreatePanelWindow(bounds)); |
| - wm::ActivateWindow(window3.get()); |
| - wm::ActivateWindow(panel2.get()); |
| - wm::ActivateWindow(panel1.get()); |
| - wm::ActivateWindow(window2.get()); |
| - wm::ActivateWindow(window1.get()); |
| - EXPECT_TRUE(wm::IsActiveWindow(window1.get())); |
| - |
| - // Cycling once highlights window2. |
| - Cycle(WindowSelector::FORWARD); |
| - // All panels are destroyed. |
| - panel1.reset(); |
| - panel2.reset(); |
| - // Cycling again should now select window3. |
| - Cycle(WindowSelector::FORWARD); |
| - StopCycling(); |
| - EXPECT_TRUE(wm::IsActiveWindow(window3.get())); |
| -} |
| - |
| -// Tests cycles between panel and normal windows. |
| -TEST_F(WindowSelectorTest, CycleMruPanelDestroyed) { |
| - 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> panel1(CreatePanelWindow(bounds)); |
| - scoped_ptr<aura::Window> panel2(CreatePanelWindow(bounds)); |
| - wm::ActivateWindow(panel2.get()); |
| - wm::ActivateWindow(panel1.get()); |
| - wm::ActivateWindow(window2.get()); |
| - wm::ActivateWindow(window1.get()); |
| - EXPECT_TRUE(wm::IsActiveWindow(window1.get())); |
| - |
| - // Cycling once highlights window2. |
| - Cycle(WindowSelector::FORWARD); |
| - // Panel 1 is the next item as the MRU panel, removing it should make panel 2 |
| - // the next window to be selected. |
| - panel1.reset(); |
| - // Cycling again should now select window3. |
| - Cycle(WindowSelector::FORWARD); |
| - StopCycling(); |
| - EXPECT_TRUE(wm::IsActiveWindow(panel2.get())); |
| -} |
| +}*/ |
|
tdanderson
2014/05/01 18:51:39
Fix this.
Nina
2014/05/01 20:41:16
Done.
|
| // Tests that a newly created window aborts overview. |
| TEST_F(WindowSelectorTest, NewWindowCancelsOveriew) { |
| @@ -637,24 +433,6 @@ TEST_F(WindowSelectorTest, ActivationCancelsOveriew) { |
| EXPECT_EQ(window1.get(), GetFocusedWindow()); |
| } |
| -// Verifies that overview mode only begins after a delay when cycling. |
| -TEST_F(WindowSelectorTest, CycleOverviewDelay) { |
| - gfx::Rect bounds(0, 0, 400, 400); |
| - scoped_ptr<aura::Window> window1(CreateWindow(bounds)); |
| - scoped_ptr<aura::Window> window2(CreateWindow(bounds)); |
| - EXPECT_TRUE(WindowsOverlapping(window1.get(), window2.get())); |
| - |
| - // When cycling first starts, the windows will still be overlapping. |
| - Cycle(WindowSelector::FORWARD); |
| - EXPECT_TRUE(IsSelecting()); |
| - EXPECT_TRUE(WindowsOverlapping(window1.get(), window2.get())); |
| - |
| - // Once the overview timer fires, the windows should no longer overlap. |
| - FireOverviewStartTimer(); |
| - EXPECT_FALSE(WindowsOverlapping(window1.get(), window2.get())); |
| - StopCycling(); |
| -} |
| - |
| // Tests that exiting overview mode without selecting a window restores focus |
| // to the previously focused window. |
| TEST_F(WindowSelectorTest, CancelRestoresFocus) { |
| @@ -831,168 +609,6 @@ TEST_F(WindowSelectorTest, MultipleDisplays) { |
| EXPECT_FALSE(WindowsOverlapping(panel1.get(), panel3.get())); |
| } |
| -// Verifies that the single display overview used during alt tab cycling uses |
| -// the display of the selected window by default. |
| -TEST_F(WindowSelectorTest, CycleOverviewUsesCurrentDisplay) { |
| - if (!SupportsMultipleDisplays()) |
| - return; |
| - |
| - UpdateDisplay("400x400,400x400"); |
| - aura::Window::Windows root_windows = Shell::GetAllRootWindows(); |
| - |
| - scoped_ptr<aura::Window> window1(CreateWindow(gfx::Rect(0, 0, 100, 100))); |
| - scoped_ptr<aura::Window> window2(CreateWindow(gfx::Rect(450, 0, 100, 100))); |
| - EXPECT_EQ(root_windows[0], window1->GetRootWindow()); |
| - EXPECT_EQ(root_windows[1], window2->GetRootWindow()); |
| - wm::ActivateWindow(window2.get()); |
| - wm::ActivateWindow(window1.get()); |
| - EXPECT_EQ(root_windows[0], Shell::GetTargetRootWindow()); |
| - |
| - Cycle(WindowSelector::FORWARD); |
| - FireOverviewStartTimer(); |
| - |
| - EXPECT_TRUE(root_windows[1]->GetBoundsInScreen().Contains( |
| - ToEnclosingRect(GetTransformedTargetBounds(window1.get())))); |
| - EXPECT_TRUE(root_windows[1]->GetBoundsInScreen().Contains( |
| - ToEnclosingRect(GetTransformedTargetBounds(window2.get())))); |
| - StopCycling(); |
| -} |
| - |
| -// Verifies that the windows being shown on another display are copied. |
| -TEST_F(WindowSelectorTest, CycleMultipleDisplaysCopiesWindows) { |
| - if (!SupportsMultipleDisplays()) |
| - return; |
| - |
| - UpdateDisplay("400x400,400x400"); |
| - aura::Window::Windows root_windows = Shell::GetAllRootWindows(); |
| - |
| - gfx::Rect root1_rect(0, 0, 100, 100); |
| - gfx::Rect root2_rect(450, 0, 100, 100); |
| - scoped_ptr<aura::Window> unmoved1(CreateWindow(root2_rect)); |
| - scoped_ptr<aura::Window> unmoved2(CreateWindow(root2_rect)); |
| - scoped_ptr<aura::Window> moved1_trans_parent(CreateWindow(root1_rect)); |
| - scoped_ptr<aura::Window> moved1(CreateWindow(root1_rect)); |
| - unmoved1->SetName("unmoved1"); |
| - unmoved2->SetName("unmoved2"); |
| - moved1->SetName("moved1"); |
| - moved1->SetProperty(aura::client::kModalKey, ui::MODAL_TYPE_WINDOW); |
| - ::wm::AddTransientChild(moved1_trans_parent.get(), moved1.get()); |
| - moved1_trans_parent->SetName("moved1_trans_parent"); |
| - |
| - EXPECT_EQ(root_windows[0], moved1->GetRootWindow()); |
| - EXPECT_EQ(root_windows[0], moved1_trans_parent->GetRootWindow()); |
| - EXPECT_EQ(root_windows[1], unmoved1->GetRootWindow()); |
| - EXPECT_EQ(root_windows[1], unmoved2->GetRootWindow()); |
| - wm::ActivateWindow(unmoved2.get()); |
| - wm::ActivateWindow(unmoved1.get()); |
| - |
| - Cycle(WindowSelector::FORWARD); |
| - FireOverviewStartTimer(); |
| - |
| - // All windows are moved to second root window. |
| - EXPECT_TRUE(root_windows[1]->GetBoundsInScreen().Contains( |
| - ToEnclosingRect(GetTransformedTargetBounds(unmoved1.get())))); |
| - EXPECT_TRUE(root_windows[1]->GetBoundsInScreen().Contains( |
| - ToEnclosingRect(GetTransformedTargetBounds(unmoved2.get())))); |
| - EXPECT_TRUE(root_windows[1]->GetBoundsInScreen().Contains( |
| - ToEnclosingRect(GetTransformedTargetBounds(moved1.get())))); |
| - EXPECT_TRUE(root_windows[1]->GetBoundsInScreen().Contains( |
| - ToEnclosingRect(GetTransformedTargetBounds(moved1_trans_parent.get())))); |
| - |
| - // unmoved1 and unmoved2 were already on the correct display and should not |
| - // have been copied. |
| - EXPECT_TRUE(!GetCopyWindow(unmoved1.get())); |
| - EXPECT_TRUE(!GetCopyWindow(unmoved2.get())); |
| - |
| - // moved1 and its transient parent moved1_trans_parent should have also been |
| - // copied for displaying on root_windows[1]. |
| - aura::Window* copy1 = GetCopyWindow(moved1.get()); |
| - aura::Window* copy1_trans_parent = GetCopyWindow(moved1_trans_parent.get()); |
| - ASSERT_FALSE(!copy1); |
| - ASSERT_FALSE(!copy1_trans_parent); |
| - |
| - // Verify that the bounds and transform of the copy match the original window |
| - // but that it is on the other root window. |
| - EXPECT_EQ(root_windows[1], copy1->GetRootWindow()); |
| - EXPECT_EQ(moved1->GetBoundsInScreen().ToString(), |
| - copy1->GetBoundsInScreen().ToString()); |
| - EXPECT_EQ(moved1->layer()->GetTargetTransform().ToString(), |
| - copy1->layer()->GetTargetTransform().ToString()); |
| - StopCycling(); |
| - |
| - // After cycling the copy windows should have been destroyed. |
| - RunAllPendingInMessageLoop(); |
| - EXPECT_TRUE(!GetCopyWindow(moved1.get())); |
| - EXPECT_TRUE(!GetCopyWindow(moved1_trans_parent.get())); |
| -} |
| - |
| -// Tests that beginning to cycle from overview mode moves windows to the |
| -// active display. |
| -TEST_F(WindowSelectorTest, MultipleDisplaysOverviewTransitionToCycle) { |
| - if (!SupportsMultipleDisplays()) |
| - return; |
| - |
| - UpdateDisplay("400x400,400x400"); |
| - aura::Window::Windows root_windows = Shell::GetAllRootWindows(); |
| - |
| - scoped_ptr<aura::Window> window1(CreateWindow(gfx::Rect(0, 0, 100, 100))); |
| - scoped_ptr<aura::Window> window2(CreateWindow(gfx::Rect(450, 0, 100, 100))); |
| - EXPECT_EQ(root_windows[0], window1->GetRootWindow()); |
| - EXPECT_EQ(root_windows[1], window2->GetRootWindow()); |
| - wm::ActivateWindow(window2.get()); |
| - wm::ActivateWindow(window1.get()); |
| - |
| - ToggleOverview(); |
| - EXPECT_TRUE(root_windows[0]->GetBoundsInScreen().Contains( |
| - ToEnclosingRect(GetTransformedTargetBounds(window1.get())))); |
| - EXPECT_TRUE(root_windows[1]->GetBoundsInScreen().Contains( |
| - ToEnclosingRect(GetTransformedTargetBounds(window2.get())))); |
| - |
| - Cycle(WindowSelector::FORWARD); |
| - EXPECT_TRUE(root_windows[0]->GetBoundsInScreen().Contains( |
| - ToEnclosingRect(GetTransformedTargetBounds(window1.get())))); |
| - EXPECT_TRUE(root_windows[0]->GetBoundsInScreen().Contains( |
| - ToEnclosingRect(GetTransformedTargetBounds(window2.get())))); |
| - StopCycling(); |
| -} |
| - |
| -// Tests that a bounds change during overview is corrected for. |
| -TEST_F(WindowSelectorTest, BoundsChangeDuringCycleOnOtherDisplay) { |
| - if (!SupportsMultipleDisplays()) |
| - return; |
| - |
| - UpdateDisplay("400x400,400x400"); |
| - aura::Window::Windows root_windows = Shell::GetAllRootWindows(); |
| - |
| - scoped_ptr<aura::Window> window1(CreateWindow(gfx::Rect(0, 0, 100, 100))); |
| - scoped_ptr<aura::Window> window2(CreateWindow(gfx::Rect(450, 0, 100, 100))); |
| - scoped_ptr<aura::Window> window3(CreateWindow(gfx::Rect(450, 0, 100, 100))); |
| - EXPECT_EQ(root_windows[0], window1->GetRootWindow()); |
| - EXPECT_EQ(root_windows[1], window2->GetRootWindow()); |
| - EXPECT_EQ(root_windows[1], window3->GetRootWindow()); |
| - wm::ActivateWindow(window1.get()); |
| - wm::ActivateWindow(window2.get()); |
| - wm::ActivateWindow(window3.get()); |
| - |
| - Cycle(WindowSelector::FORWARD); |
| - FireOverviewStartTimer(); |
| - |
| - gfx::Rect overview_bounds( |
| - ToEnclosingRect(GetTransformedTargetBounds(window1.get()))); |
| - EXPECT_TRUE(root_windows[1]->GetBoundsInScreen().Contains(overview_bounds)); |
| - |
| - // Change the position and size of window1 (being displayed on the second |
| - // root window) and it should remain within the same bounds. |
| - window1->SetBounds(gfx::Rect(100, 0, 200, 200)); |
| - gfx::Rect new_overview_bounds = |
| - ToEnclosingRect(GetTransformedTargetBounds(window1.get())); |
| - EXPECT_EQ(overview_bounds.x(), new_overview_bounds.x()); |
| - EXPECT_EQ(overview_bounds.y(), new_overview_bounds.y()); |
| - EXPECT_EQ(overview_bounds.width(), new_overview_bounds.width()); |
| - EXPECT_EQ(overview_bounds.height(), new_overview_bounds.height()); |
| - StopCycling(); |
| -} |
| - |
| // Tests shutting down during overview. |
| TEST_F(WindowSelectorTest, Shutdown) { |
| gfx::Rect bounds(0, 0, 400, 400); |