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/test/ash_test_base.h" | 5 #include "ash/test/ash_test_base.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "ash/ash_switches.h" | 10 #include "ash/ash_switches.h" |
11 #include "ash/display/display_controller.h" | 11 #include "ash/display/display_controller.h" |
12 #include "ash/shell.h" | 12 #include "ash/shell.h" |
13 #include "ash/shell/toplevel_window.h" | 13 #include "ash/shell/toplevel_window.h" |
14 #include "ash/test/ash_test_helper.h" | 14 #include "ash/test/ash_test_helper.h" |
15 #include "ash/test/display_manager_test_api.h" | 15 #include "ash/test/display_manager_test_api.h" |
16 #include "ash/test/test_session_state_delegate.h" | 16 #include "ash/test/test_session_state_delegate.h" |
17 #include "ash/test/test_shell_delegate.h" | 17 #include "ash/test/test_shell_delegate.h" |
18 #include "ash/test/test_system_tray_delegate.h" | 18 #include "ash/test/test_system_tray_delegate.h" |
19 #include "ash/wm/window_positioner.h" | 19 #include "ash/wm/window_positioner.h" |
20 #include "base/command_line.h" | 20 #include "base/command_line.h" |
21 #include "ui/aura/client/aura_constants.h" | 21 #include "ui/aura/client/aura_constants.h" |
22 #include "ui/aura/client/screen_position_client.h" | 22 #include "ui/aura/client/screen_position_client.h" |
23 #include "ui/aura/client/window_tree_client.h" | 23 #include "ui/aura/client/window_tree_client.h" |
24 #include "ui/aura/test/event_generator_delegate_aura.h" | 24 #include "ui/aura/test/event_generator_delegate_aura.h" |
25 #include "ui/aura/test/test_window_delegate.h" | 25 #include "ui/aura/test/test_window_delegate.h" |
26 #include "ui/aura/window.h" | 26 #include "ui/aura/window.h" |
27 #include "ui/aura/window_delegate.h" | 27 #include "ui/aura/window_delegate.h" |
28 #include "ui/aura/window_tree_host.h" | 28 #include "ui/aura/window_tree_host.h" |
29 #include "ui/base/ime/input_method_initializer.h" | 29 #include "ui/base/ime/input_method_initializer.h" |
30 #include "ui/events/gestures/gesture_configuration.h" | 30 #include "ui/events/gesture_detection/gesture_configuration.h" |
31 #include "ui/gfx/display.h" | 31 #include "ui/gfx/display.h" |
32 #include "ui/gfx/point.h" | 32 #include "ui/gfx/point.h" |
33 #include "ui/gfx/screen.h" | 33 #include "ui/gfx/screen.h" |
34 #include "ui/wm/core/coordinate_conversion.h" | 34 #include "ui/wm/core/coordinate_conversion.h" |
35 | 35 |
36 #if defined(OS_CHROMEOS) | 36 #if defined(OS_CHROMEOS) |
37 #include "ash/system/chromeos/tray_display.h" | 37 #include "ash/system/chromeos/tray_display.h" |
38 #endif | 38 #endif |
39 | 39 |
40 #if defined(OS_WIN) | 40 #if defined(OS_WIN) |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 ash_test_helper_->SetUp(start_session_); | 128 ash_test_helper_->SetUp(start_session_); |
129 | 129 |
130 Shell::GetPrimaryRootWindow()->Show(); | 130 Shell::GetPrimaryRootWindow()->Show(); |
131 Shell::GetPrimaryRootWindow()->GetHost()->Show(); | 131 Shell::GetPrimaryRootWindow()->GetHost()->Show(); |
132 // Move the mouse cursor to far away so that native events doesn't | 132 // Move the mouse cursor to far away so that native events doesn't |
133 // interfere test expectations. | 133 // interfere test expectations. |
134 Shell::GetPrimaryRootWindow()->MoveCursorTo(gfx::Point(-1000, -1000)); | 134 Shell::GetPrimaryRootWindow()->MoveCursorTo(gfx::Point(-1000, -1000)); |
135 ash::Shell::GetInstance()->cursor_manager()->EnableMouseEvents(); | 135 ash::Shell::GetInstance()->cursor_manager()->EnableMouseEvents(); |
136 | 136 |
137 // Changing GestureConfiguration shouldn't make tests fail. | 137 // Changing GestureConfiguration shouldn't make tests fail. |
138 ui::GestureConfiguration::set_max_touch_move_in_pixels_for_click(5); | 138 ui::GestureConfiguration::GetInstance() |
| 139 ->set_max_touch_move_in_pixels_for_click(5); |
139 | 140 |
140 #if defined(OS_WIN) | 141 #if defined(OS_WIN) |
141 if (!command_line->HasSwitch(ash::switches::kForceAshToDesktop)) { | 142 if (!command_line->HasSwitch(ash::switches::kForceAshToDesktop)) { |
142 if (base::win::GetVersion() >= base::win::VERSION_WIN8) { | 143 if (base::win::GetVersion() >= base::win::VERSION_WIN8) { |
143 ipc_thread_.reset(new base::Thread("test_metro_viewer_ipc_thread")); | 144 ipc_thread_.reset(new base::Thread("test_metro_viewer_ipc_thread")); |
144 base::Thread::Options options; | 145 base::Thread::Options options; |
145 options.message_loop_type = base::MessageLoop::TYPE_IO; | 146 options.message_loop_type = base::MessageLoop::TYPE_IO; |
146 ipc_thread_->StartWithOptions(options); | 147 ipc_thread_->StartWithOptions(options); |
147 metro_viewer_host_.reset( | 148 metro_viewer_host_.reset( |
148 new TestMetroViewerProcessHost(ipc_thread_->message_loop_proxy())); | 149 new TestMetroViewerProcessHost(ipc_thread_->message_loop_proxy())); |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
331 | 332 |
332 void AshTestBase::UnblockUserSession() { | 333 void AshTestBase::UnblockUserSession() { |
333 Shell::GetInstance()->session_state_delegate()->UnlockScreen(); | 334 Shell::GetInstance()->session_state_delegate()->UnlockScreen(); |
334 SetSessionStarted(true); | 335 SetSessionStarted(true); |
335 SetUserAddingScreenRunning(false); | 336 SetUserAddingScreenRunning(false); |
336 } | 337 } |
337 | 338 |
338 | 339 |
339 } // namespace test | 340 } // namespace test |
340 } // namespace ash | 341 } // namespace ash |
OLD | NEW |