OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/wm/workspace/workspace_window_resizer.h" | 5 #include "ash/wm/workspace/workspace_window_resizer.h" |
6 | 6 |
7 #include "ash/display/display_manager.h" | 7 #include "ash/display/display_manager.h" |
8 #include "ash/root_window_controller.h" | 8 #include "ash/root_window_controller.h" |
9 #include "ash/screen_util.h" | 9 #include "ash/screen_util.h" |
10 #include "ash/shelf/shelf_layout_manager.h" | 10 #include "ash/shelf/shelf_layout_manager.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/wm/window_state.h" | 14 #include "ash/wm/window_state.h" |
15 #include "ash/wm/window_util.h" | 15 #include "ash/wm/window_util.h" |
16 #include "ash/wm/wm_event.h" | 16 #include "ash/wm/wm_event.h" |
17 #include "ash/wm/workspace/phantom_window_controller.h" | 17 #include "ash/wm/workspace/phantom_window_controller.h" |
18 #include "ash/wm/workspace_controller.h" | 18 #include "ash/wm/workspace_controller.h" |
19 #include "base/command_line.h" | 19 #include "base/command_line.h" |
20 #include "base/strings/string_number_conversions.h" | 20 #include "base/strings/string_number_conversions.h" |
21 #include "base/strings/stringprintf.h" | 21 #include "base/strings/stringprintf.h" |
22 #include "ui/aura/client/aura_constants.h" | 22 #include "ui/aura/client/aura_constants.h" |
23 #include "ui/aura/test/test_window_delegate.h" | 23 #include "ui/aura/test/test_window_delegate.h" |
24 #include "ui/aura/window_event_dispatcher.h" | 24 #include "ui/aura/window_event_dispatcher.h" |
25 #include "ui/base/hit_test.h" | 25 #include "ui/base/hit_test.h" |
26 #include "ui/events/gestures/gesture_configuration.h" | 26 #include "ui/events/gesture_detection/gesture_configuration.h" |
27 #include "ui/events/test/event_generator.h" | 27 #include "ui/events/test/event_generator.h" |
28 #include "ui/gfx/insets.h" | 28 #include "ui/gfx/insets.h" |
29 #include "ui/gfx/screen.h" | 29 #include "ui/gfx/screen.h" |
30 #include "ui/views/widget/widget.h" | 30 #include "ui/views/widget/widget.h" |
31 | 31 |
32 namespace ash { | 32 namespace ash { |
33 namespace { | 33 namespace { |
34 | 34 |
35 const int kRootHeight = 600; | 35 const int kRootHeight = 600; |
36 | 36 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 | 69 |
70 class WorkspaceWindowResizerTest : public test::AshTestBase { | 70 class WorkspaceWindowResizerTest : public test::AshTestBase { |
71 public: | 71 public: |
72 WorkspaceWindowResizerTest() : workspace_resizer_(NULL) {} | 72 WorkspaceWindowResizerTest() : workspace_resizer_(NULL) {} |
73 virtual ~WorkspaceWindowResizerTest() {} | 73 virtual ~WorkspaceWindowResizerTest() {} |
74 | 74 |
75 virtual void SetUp() override { | 75 virtual void SetUp() override { |
76 AshTestBase::SetUp(); | 76 AshTestBase::SetUp(); |
77 UpdateDisplay(base::StringPrintf("800x%d", kRootHeight)); | 77 UpdateDisplay(base::StringPrintf("800x%d", kRootHeight)); |
78 // Ignore the touch slop region. | 78 // Ignore the touch slop region. |
79 ui::GestureConfiguration::set_max_touch_move_in_pixels_for_click(0); | 79 ui::GestureConfiguration::GetInstance() |
| 80 ->set_max_touch_move_in_pixels_for_click(0); |
80 | 81 |
81 aura::Window* root = Shell::GetPrimaryRootWindow(); | 82 aura::Window* root = Shell::GetPrimaryRootWindow(); |
82 gfx::Rect root_bounds(root->bounds()); | 83 gfx::Rect root_bounds(root->bounds()); |
83 #if defined(OS_WIN) | 84 #if defined(OS_WIN) |
84 // RootWindow and Display can't resize on Windows Ash. | 85 // RootWindow and Display can't resize on Windows Ash. |
85 // http://crbug.com/165962 | 86 // http://crbug.com/165962 |
86 EXPECT_EQ(kRootHeight, root_bounds.height()); | 87 EXPECT_EQ(kRootHeight, root_bounds.height()); |
87 #endif | 88 #endif |
88 EXPECT_EQ(800, root_bounds.width()); | 89 EXPECT_EQ(800, root_bounds.width()); |
89 Shell::GetInstance()->SetDisplayWorkAreaInsets(root, gfx::Insets()); | 90 Shell::GetInstance()->SetDisplayWorkAreaInsets(root, gfx::Insets()); |
(...skipping 1790 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1880 // Drag even more to snap to the edge. | 1881 // Drag even more to snap to the edge. |
1881 generator.GestureScrollSequence(gfx::Point(400, kRootHeight - 40), | 1882 generator.GestureScrollSequence(gfx::Point(400, kRootHeight - 40), |
1882 gfx::Point(400, kRootHeight - 25), | 1883 gfx::Point(400, kRootHeight - 25), |
1883 base::TimeDelta::FromMilliseconds(10), | 1884 base::TimeDelta::FromMilliseconds(10), |
1884 5); | 1885 5); |
1885 EXPECT_EQ(gfx::Rect(100, 100, 600, kRootHeight - 100).ToString(), | 1886 EXPECT_EQ(gfx::Rect(100, 100, 600, kRootHeight - 100).ToString(), |
1886 touch_resize_window_->bounds().ToString()); | 1887 touch_resize_window_->bounds().ToString()); |
1887 } | 1888 } |
1888 | 1889 |
1889 } // namespace ash | 1890 } // namespace ash |
OLD | NEW |