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

Side by Side Diff: ash/wm/overview/window_selector_unittest.cc

Issue 327873005: Fixed panel callout widgets showing up in the overview. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed last nits. 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 unified diff | Download patch
« no previous file with comments | « ash/wm/overview/window_selector_panels.cc ('k') | ash/wm/panels/panel_layout_manager.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
11 #include "ash/shell.h" 11 #include "ash/shell.h"
12 #include "ash/shell_window_ids.h" 12 #include "ash/shell_window_ids.h"
13 #include "ash/test/ash_test_base.h" 13 #include "ash/test/ash_test_base.h"
14 #include "ash/test/shelf_test_api.h" 14 #include "ash/test/shelf_test_api.h"
15 #include "ash/test/shelf_view_test_api.h" 15 #include "ash/test/shelf_view_test_api.h"
16 #include "ash/test/shell_test_api.h" 16 #include "ash/test/shell_test_api.h"
17 #include "ash/test/test_shelf_delegate.h" 17 #include "ash/test/test_shelf_delegate.h"
18 #include "ash/wm/mru_window_tracker.h" 18 #include "ash/wm/mru_window_tracker.h"
19 #include "ash/wm/overview/window_grid.h" 19 #include "ash/wm/overview/window_grid.h"
20 #include "ash/wm/overview/window_selector.h" 20 #include "ash/wm/overview/window_selector.h"
21 #include "ash/wm/overview/window_selector_controller.h" 21 #include "ash/wm/overview/window_selector_controller.h"
22 #include "ash/wm/overview/window_selector_item.h" 22 #include "ash/wm/overview/window_selector_item.h"
23 #include "ash/wm/panels/panel_layout_manager.h"
23 #include "ash/wm/window_state.h" 24 #include "ash/wm/window_state.h"
24 #include "ash/wm/window_util.h" 25 #include "ash/wm/window_util.h"
25 #include "ash/wm/wm_event.h" 26 #include "ash/wm/wm_event.h"
26 #include "base/basictypes.h" 27 #include "base/basictypes.h"
27 #include "base/compiler_specific.h" 28 #include "base/compiler_specific.h"
28 #include "base/memory/scoped_vector.h" 29 #include "base/memory/scoped_vector.h"
29 #include "base/run_loop.h" 30 #include "base/run_loop.h"
30 #include "base/strings/utf_string_conversions.h" 31 #include "base/strings/utf_string_conversions.h"
31 #include "ui/aura/client/aura_constants.h" 32 #include "ui/aura/client/aura_constants.h"
32 #include "ui/aura/client/cursor_client.h" 33 #include "ui/aura/client/cursor_client.h"
(...skipping 847 matching lines...) Expand 10 before | Expand all | Expand 10 after
880 881
881 // Select the second window. 882 // Select the second window.
882 ToggleOverview(); 883 ToggleOverview();
883 SendKey(ui::VKEY_RIGHT); 884 SendKey(ui::VKEY_RIGHT);
884 SendKey(ui::VKEY_RIGHT); 885 SendKey(ui::VKEY_RIGHT);
885 SendKey(ui::VKEY_RETURN); 886 SendKey(ui::VKEY_RETURN);
886 EXPECT_FALSE(IsSelecting()); 887 EXPECT_FALSE(IsSelecting());
887 EXPECT_TRUE(wm::IsActiveWindow(window2.get())); 888 EXPECT_TRUE(wm::IsActiveWindow(window2.get()));
888 } 889 }
889 890
891 // Tests that overview mode hides the callout widget.
892 TEST_F(WindowSelectorTest, WindowOverviewHidesCalloutWidgets) {
893 scoped_ptr<aura::Window> panel1(CreatePanelWindow(gfx::Rect(0, 0, 100, 100)));
894 scoped_ptr<aura::Window> panel2(CreatePanelWindow(gfx::Rect(0, 0, 100, 100)));
895 PanelLayoutManager* panel_manager =
896 static_cast<PanelLayoutManager*>(panel1->parent()->layout_manager());
897
898 // By default, panel callout widgets are visible.
899 EXPECT_TRUE(
900 panel_manager->GetCalloutWidgetForPanel(panel1.get())->IsVisible());
901 EXPECT_TRUE(
902 panel_manager->GetCalloutWidgetForPanel(panel2.get())->IsVisible());
903
904 // Toggling the overview should hide the callout widgets.
905 ToggleOverview();
906 EXPECT_FALSE(
907 panel_manager->GetCalloutWidgetForPanel(panel1.get())->IsVisible());
908 EXPECT_FALSE(
909 panel_manager->GetCalloutWidgetForPanel(panel2.get())->IsVisible());
910
911 // Ending the overview should show them again.
912 ToggleOverview();
913 EXPECT_TRUE(
914 panel_manager->GetCalloutWidgetForPanel(panel1.get())->IsVisible());
915 EXPECT_TRUE(
916 panel_manager->GetCalloutWidgetForPanel(panel2.get())->IsVisible());
917 }
918
890 } // namespace ash 919 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/overview/window_selector_panels.cc ('k') | ash/wm/panels/panel_layout_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698