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

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

Issue 2906803002: Rename MaximizeMode to TabletMode (Closed)
Patch Set: updated filter Created 3 years, 7 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
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 <algorithm> 5 #include <algorithm>
6 #include <vector> 6 #include <vector>
7 7
8 #include "ash/accessibility_delegate.h" 8 #include "ash/accessibility_delegate.h"
9 #include "ash/accessibility_types.h" 9 #include "ash/accessibility_types.h"
10 #include "ash/drag_drop/drag_drop_controller.h" 10 #include "ash/drag_drop/drag_drop_controller.h"
11 #include "ash/public/cpp/config.h" 11 #include "ash/public/cpp/config.h"
12 #include "ash/public/cpp/window_properties.h" 12 #include "ash/public/cpp/window_properties.h"
13 #include "ash/shelf/shelf.h" 13 #include "ash/shelf/shelf.h"
14 #include "ash/shell.h" 14 #include "ash/shell.h"
15 #include "ash/system/tray/system_tray.h" 15 #include "ash/system/tray/system_tray.h"
16 #include "ash/test/ash_test_base.h" 16 #include "ash/test/ash_test_base.h"
17 #include "ash/test/shelf_view_test_api.h" 17 #include "ash/test/shelf_view_test_api.h"
18 #include "ash/test/shell_test_api.h" 18 #include "ash/test/shell_test_api.h"
19 #include "ash/test/test_app_list_view_presenter_impl.h" 19 #include "ash/test/test_app_list_view_presenter_impl.h"
20 #include "ash/wm/maximize_mode/maximize_mode_controller.h"
21 #include "ash/wm/overview/window_grid.h" 20 #include "ash/wm/overview/window_grid.h"
22 #include "ash/wm/overview/window_selector.h" 21 #include "ash/wm/overview/window_selector.h"
23 #include "ash/wm/overview/window_selector_controller.h" 22 #include "ash/wm/overview/window_selector_controller.h"
24 #include "ash/wm/overview/window_selector_item.h" 23 #include "ash/wm/overview/window_selector_item.h"
25 #include "ash/wm/panels/panel_layout_manager.h" 24 #include "ash/wm/panels/panel_layout_manager.h"
25 #include "ash/wm/tablet_mode/tablet_mode_controller.h"
26 #include "ash/wm/window_state.h" 26 #include "ash/wm/window_state.h"
27 #include "ash/wm/window_util.h" 27 #include "ash/wm/window_util.h"
28 #include "ash/wm/wm_event.h" 28 #include "ash/wm/wm_event.h"
29 #include "ash/wm/workspace/workspace_window_resizer.h" 29 #include "ash/wm/workspace/workspace_window_resizer.h"
30 #include "ash/wm_window.h" 30 #include "ash/wm_window.h"
31 #include "base/strings/string_number_conversions.h" 31 #include "base/strings/string_number_conversions.h"
32 #include "base/strings/utf_string_conversions.h" 32 #include "base/strings/utf_string_conversions.h"
33 #include "base/test/user_action_tester.h" 33 #include "base/test/user_action_tester.h"
34 #include "ui/aura/client/aura_constants.h" 34 #include "ui/aura/client/aura_constants.h"
35 #include "ui/aura/client/focus_client.h" 35 #include "ui/aura/client/focus_client.h"
(...skipping 847 matching lines...) Expand 10 before | Expand all | Expand 10 after
883 // TODO(flackr): Currently the panel remains hidden, but should become visible 883 // TODO(flackr): Currently the panel remains hidden, but should become visible
884 // again. 884 // again.
885 ToggleOverview(); 885 ToggleOverview();
886 ClickWindow(window2.get()); 886 ClickWindow(window2.get());
887 EXPECT_TRUE(wm::GetWindowState(window1.get())->IsFullscreen()); 887 EXPECT_TRUE(wm::GetWindowState(window1.get())->IsFullscreen());
888 } 888 }
889 889
890 // Tests that entering overview when a fullscreen window is active in maximized 890 // Tests that entering overview when a fullscreen window is active in maximized
891 // mode correctly applies the transformations to the window and correctly 891 // mode correctly applies the transformations to the window and correctly
892 // updates the window bounds on exiting overview mode: http://crbug.com/401664. 892 // updates the window bounds on exiting overview mode: http://crbug.com/401664.
893 TEST_F(WindowSelectorTest, FullscreenWindowMaximizeMode) { 893 TEST_F(WindowSelectorTest, FullscreenWindowTabletMode) {
894 gfx::Rect bounds(0, 0, 400, 400); 894 gfx::Rect bounds(0, 0, 400, 400);
895 std::unique_ptr<aura::Window> window1(CreateWindow(bounds)); 895 std::unique_ptr<aura::Window> window1(CreateWindow(bounds));
896 std::unique_ptr<aura::Window> window2(CreateWindow(bounds)); 896 std::unique_ptr<aura::Window> window2(CreateWindow(bounds));
897 Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( 897 Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(true);
898 true);
899 wm::ActivateWindow(window2.get()); 898 wm::ActivateWindow(window2.get());
900 wm::ActivateWindow(window1.get()); 899 wm::ActivateWindow(window1.get());
901 gfx::Rect normal_window_bounds(window1->bounds()); 900 gfx::Rect normal_window_bounds(window1->bounds());
902 const wm::WMEvent toggle_fullscreen_event(wm::WM_EVENT_TOGGLE_FULLSCREEN); 901 const wm::WMEvent toggle_fullscreen_event(wm::WM_EVENT_TOGGLE_FULLSCREEN);
903 wm::GetWindowState(window1.get())->OnWMEvent(&toggle_fullscreen_event); 902 wm::GetWindowState(window1.get())->OnWMEvent(&toggle_fullscreen_event);
904 gfx::Rect fullscreen_window_bounds(window1->bounds()); 903 gfx::Rect fullscreen_window_bounds(window1->bounds());
905 EXPECT_NE(normal_window_bounds.ToString(), 904 EXPECT_NE(normal_window_bounds.ToString(),
906 fullscreen_window_bounds.ToString()); 905 fullscreen_window_bounds.ToString());
907 EXPECT_EQ(fullscreen_window_bounds.ToString(), 906 EXPECT_EQ(fullscreen_window_bounds.ToString(),
908 window2->GetTargetBounds().ToString()); 907 window2->GetTargetBounds().ToString());
(...skipping 942 matching lines...) Expand 10 before | Expand all | Expand 10 after
1851 aura::client::WINDOW_MOVE_SOURCE_MOUSE)); 1850 aura::client::WINDOW_MOVE_SOURCE_MOUSE));
1852 ASSERT_TRUE(resizer.get()); 1851 ASSERT_TRUE(resizer.get());
1853 gfx::Point location = resizer->GetInitialLocation(); 1852 gfx::Point location = resizer->GetInitialLocation();
1854 location.Offset(20, 20); 1853 location.Offset(20, 20);
1855 resizer->Drag(location, 0); 1854 resizer->Drag(location, 0);
1856 ToggleOverview(); 1855 ToggleOverview();
1857 resizer->RevertDrag(); 1856 resizer->RevertDrag();
1858 } 1857 }
1859 1858
1860 } // namespace ash 1859 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698