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 <algorithm> | 5 #include <algorithm> |
6 #include <vector> | 6 #include <vector> |
7 | 7 |
| 8 #include "ash/app_list/app_list_presenter_delegate_factory.h" |
8 #include "ash/aura/wm_window_aura.h" | 9 #include "ash/aura/wm_window_aura.h" |
9 #include "ash/common/accessibility_delegate.h" | 10 #include "ash/common/accessibility_delegate.h" |
10 #include "ash/common/accessibility_types.h" | 11 #include "ash/common/accessibility_types.h" |
11 #include "ash/common/ash_switches.h" | 12 #include "ash/common/ash_switches.h" |
12 #include "ash/common/shelf/shelf_widget.h" | 13 #include "ash/common/shelf/shelf_widget.h" |
13 #include "ash/common/shelf/wm_shelf.h" | 14 #include "ash/common/shelf/wm_shelf.h" |
14 #include "ash/common/system/tray/system_tray.h" | 15 #include "ash/common/system/tray/system_tray.h" |
15 #include "ash/common/test/test_shelf_delegate.h" | 16 #include "ash/common/test/test_shelf_delegate.h" |
16 #include "ash/common/wm/dock/docked_window_layout_manager.h" | 17 #include "ash/common/wm/dock/docked_window_layout_manager.h" |
17 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h" | 18 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h" |
(...skipping 21 matching lines...) Expand all Loading... |
39 #include "ash/wm/window_state_aura.h" | 40 #include "ash/wm/window_state_aura.h" |
40 #include "ash/wm/window_util.h" | 41 #include "ash/wm/window_util.h" |
41 #include "base/command_line.h" | 42 #include "base/command_line.h" |
42 #include "base/compiler_specific.h" | 43 #include "base/compiler_specific.h" |
43 #include "base/memory/scoped_vector.h" | 44 #include "base/memory/scoped_vector.h" |
44 #include "base/run_loop.h" | 45 #include "base/run_loop.h" |
45 #include "base/strings/string_piece.h" | 46 #include "base/strings/string_piece.h" |
46 #include "base/strings/utf_string_conversions.h" | 47 #include "base/strings/utf_string_conversions.h" |
47 #include "base/test/user_action_tester.h" | 48 #include "base/test/user_action_tester.h" |
48 #include "base/threading/thread_task_runner_handle.h" | 49 #include "base/threading/thread_task_runner_handle.h" |
| 50 #include "ui/app_list/presenter/app_list_presenter_impl.h" |
| 51 #include "ui/app_list/presenter/test/test_app_list_view_delegate_factory.h" |
49 #include "ui/aura/client/aura_constants.h" | 52 #include "ui/aura/client/aura_constants.h" |
50 #include "ui/aura/client/cursor_client.h" | 53 #include "ui/aura/client/cursor_client.h" |
51 #include "ui/aura/client/focus_client.h" | 54 #include "ui/aura/client/focus_client.h" |
52 #include "ui/aura/test/test_window_delegate.h" | 55 #include "ui/aura/test/test_window_delegate.h" |
53 #include "ui/aura/test/test_windows.h" | 56 #include "ui/aura/test/test_windows.h" |
54 #include "ui/aura/window.h" | 57 #include "ui/aura/window.h" |
55 #include "ui/aura/window_event_dispatcher.h" | 58 #include "ui/aura/window_event_dispatcher.h" |
56 #include "ui/base/hit_test.h" | 59 #include "ui/base/hit_test.h" |
57 #include "ui/compositor/scoped_animation_duration_scale_mode.h" | 60 #include "ui/compositor/scoped_animation_duration_scale_mode.h" |
58 #include "ui/display/display_layout.h" | 61 #include "ui/display/display_layout.h" |
(...skipping 1141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1200 ClickWindow(window2.get()); | 1203 ClickWindow(window2.get()); |
1201 EXPECT_EQ(normal_window_bounds.ToString(), | 1204 EXPECT_EQ(normal_window_bounds.ToString(), |
1202 window2->GetTargetBounds().ToString()); | 1205 window2->GetTargetBounds().ToString()); |
1203 } | 1206 } |
1204 | 1207 |
1205 // Tests that beginning window selection hides the app list. | 1208 // Tests that beginning window selection hides the app list. |
1206 TEST_F(WindowSelectorTest, SelectingHidesAppList) { | 1209 TEST_F(WindowSelectorTest, SelectingHidesAppList) { |
1207 gfx::Rect bounds(0, 0, 400, 400); | 1210 gfx::Rect bounds(0, 0, 400, 400); |
1208 std::unique_ptr<aura::Window> window1(CreateWindow(bounds)); | 1211 std::unique_ptr<aura::Window> window1(CreateWindow(bounds)); |
1209 std::unique_ptr<aura::Window> window2(CreateWindow(bounds)); | 1212 std::unique_ptr<aura::Window> window2(CreateWindow(bounds)); |
1210 WmShell::Get()->ShowAppList(); | 1213 |
1211 EXPECT_TRUE(WmShell::Get()->GetAppListTargetVisibility()); | 1214 // The tested behavior relies on the app list presenter delegate. |
| 1215 AppListPresenterDelegateFactory app_list_presenter_delegate_factory( |
| 1216 base::MakeUnique<app_list::TestAppListViewDelegateFactory>()); |
| 1217 app_list::AppListPresenterImpl app_list_presenter_impl( |
| 1218 &app_list_presenter_delegate_factory); |
| 1219 |
| 1220 app_list_presenter_impl.Show(display_manager()->first_display_id()); |
| 1221 EXPECT_TRUE(app_list_presenter_impl.IsVisible()); |
| 1222 |
1212 ToggleOverview(); | 1223 ToggleOverview(); |
1213 EXPECT_FALSE(WmShell::Get()->GetAppListTargetVisibility()); | 1224 EXPECT_FALSE(app_list_presenter_impl.IsVisible()); |
1214 ToggleOverview(); | 1225 ToggleOverview(); |
1215 } | 1226 } |
1216 | 1227 |
1217 // Tests that a minimized window's visibility and layer visibility is correctly | 1228 // Tests that a minimized window's visibility and layer visibility is correctly |
1218 // changed when entering overview and restored when leaving overview mode. | 1229 // changed when entering overview and restored when leaving overview mode. |
1219 // Crashes after the skia roll in http://crrev.com/274114. | 1230 // Crashes after the skia roll in http://crrev.com/274114. |
1220 // http://crbug.com/379570 | 1231 // http://crbug.com/379570 |
1221 TEST_F(WindowSelectorTest, DISABLED_MinimizedWindowVisibility) { | 1232 TEST_F(WindowSelectorTest, DISABLED_MinimizedWindowVisibility) { |
1222 gfx::Rect bounds(0, 0, 400, 400); | 1233 gfx::Rect bounds(0, 0, 400, 400); |
1223 std::unique_ptr<aura::Window> window1(CreateWindow(bounds)); | 1234 std::unique_ptr<aura::Window> window1(CreateWindow(bounds)); |
(...skipping 898 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2122 HTCAPTION, aura::client::WINDOW_MOVE_SOURCE_MOUSE)); | 2133 HTCAPTION, aura::client::WINDOW_MOVE_SOURCE_MOUSE)); |
2123 ASSERT_TRUE(resizer.get()); | 2134 ASSERT_TRUE(resizer.get()); |
2124 gfx::Point location = resizer->GetInitialLocation(); | 2135 gfx::Point location = resizer->GetInitialLocation(); |
2125 location.Offset(20, 20); | 2136 location.Offset(20, 20); |
2126 resizer->Drag(location, 0); | 2137 resizer->Drag(location, 0); |
2127 ToggleOverview(); | 2138 ToggleOverview(); |
2128 resizer->RevertDrag(); | 2139 resizer->RevertDrag(); |
2129 } | 2140 } |
2130 | 2141 |
2131 } // namespace ash | 2142 } // namespace ash |
OLD | NEW |