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" |
(...skipping 12 matching lines...) Expand all Loading... |
23 #include "ui/aura/root_window.h" | 23 #include "ui/aura/root_window.h" |
24 #include "ui/aura/test/event_generator.h" | 24 #include "ui/aura/test/event_generator.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/base/ime/input_method_initializer.h" | 28 #include "ui/base/ime/input_method_initializer.h" |
29 #include "ui/gfx/display.h" | 29 #include "ui/gfx/display.h" |
30 #include "ui/gfx/point.h" | 30 #include "ui/gfx/point.h" |
31 #include "ui/gfx/screen.h" | 31 #include "ui/gfx/screen.h" |
32 | 32 |
| 33 #if defined(OS_CHROMEOS) |
| 34 #include "ash/system/chromeos/tray_display.h" |
| 35 #endif |
| 36 |
33 #if defined(OS_WIN) | 37 #if defined(OS_WIN) |
34 #include "ash/test/test_metro_viewer_process_host.h" | 38 #include "ash/test/test_metro_viewer_process_host.h" |
35 #include "base/test/test_process_killer_win.h" | 39 #include "base/test/test_process_killer_win.h" |
36 #include "base/win/metro.h" | 40 #include "base/win/metro.h" |
37 #include "base/win/windows_version.h" | 41 #include "base/win/windows_version.h" |
38 #include "ui/aura/remote_root_window_host_win.h" | 42 #include "ui/aura/remote_root_window_host_win.h" |
39 #include "ui/aura/root_window_host_win.h" | 43 #include "ui/aura/root_window_host_win.h" |
40 #include "win8/test/test_registrar_constants.h" | 44 #include "win8/test/test_registrar_constants.h" |
41 #endif | 45 #endif |
42 | 46 |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 | 111 |
108 ash_test_helper_->SetUp(); | 112 ash_test_helper_->SetUp(); |
109 | 113 |
110 Shell::GetPrimaryRootWindow()->Show(); | 114 Shell::GetPrimaryRootWindow()->Show(); |
111 Shell::GetPrimaryRootWindow()->ShowRootWindow(); | 115 Shell::GetPrimaryRootWindow()->ShowRootWindow(); |
112 // Move the mouse cursor to far away so that native events doesn't | 116 // Move the mouse cursor to far away so that native events doesn't |
113 // interfere test expectations. | 117 // interfere test expectations. |
114 Shell::GetPrimaryRootWindow()->MoveCursorTo(gfx::Point(-1000, -1000)); | 118 Shell::GetPrimaryRootWindow()->MoveCursorTo(gfx::Point(-1000, -1000)); |
115 ash::Shell::GetInstance()->cursor_manager()->EnableMouseEvents(); | 119 ash::Shell::GetInstance()->cursor_manager()->EnableMouseEvents(); |
116 | 120 |
| 121 #if defined(OS_CHROMEOS) |
| 122 // We do not want to see the notification for display configuration change, |
| 123 // since it may trap mouse events unexpectedly. |
| 124 // TODO(mukai): remove this code when the display notification code is moved |
| 125 // to the message center. |
| 126 internal::TrayDisplay::SetDisplayNotificationsEnabledForTest(false); |
| 127 #endif |
| 128 |
117 #if defined(OS_WIN) | 129 #if defined(OS_WIN) |
118 if (base::win::GetVersion() >= base::win::VERSION_WIN8 && | 130 if (base::win::GetVersion() >= base::win::VERSION_WIN8 && |
119 !CommandLine::ForCurrentProcess()->HasSwitch( | 131 !CommandLine::ForCurrentProcess()->HasSwitch( |
120 ash::switches::kForceAshToDesktop)) { | 132 ash::switches::kForceAshToDesktop)) { |
121 ipc_thread_.reset(new base::Thread("test_metro_viewer_ipc_thread")); | 133 ipc_thread_.reset(new base::Thread("test_metro_viewer_ipc_thread")); |
122 base::Thread::Options options; | 134 base::Thread::Options options; |
123 options.message_loop_type = base::MessageLoop::TYPE_IO; | 135 options.message_loop_type = base::MessageLoop::TYPE_IO; |
124 ipc_thread_->StartWithOptions(options); | 136 ipc_thread_->StartWithOptions(options); |
125 | 137 |
126 metro_viewer_host_.reset( | 138 metro_viewer_host_.reset( |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 SetHasActiveUser(user_logged_in); | 284 SetHasActiveUser(user_logged_in); |
273 } | 285 } |
274 | 286 |
275 void AshTestBase::SetCanLockScreen(bool can_lock_screen) { | 287 void AshTestBase::SetCanLockScreen(bool can_lock_screen) { |
276 ash_test_helper_->test_shell_delegate()->test_session_state_delegate()-> | 288 ash_test_helper_->test_shell_delegate()->test_session_state_delegate()-> |
277 SetCanLockScreen(can_lock_screen); | 289 SetCanLockScreen(can_lock_screen); |
278 } | 290 } |
279 | 291 |
280 } // namespace test | 292 } // namespace test |
281 } // namespace ash | 293 } // namespace ash |
OLD | NEW |