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 26 matching lines...) Expand all Loading... |
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) |
41 #include "ash/test/test_metro_viewer_process_host.h" | 41 #include "ash/test/test_metro_viewer_process_host.h" |
42 #include "base/test/test_process_killer_win.h" | 42 #include "base/test/test_process_killer_win.h" |
43 #include "base/win/metro.h" | 43 #include "base/win/metro.h" |
44 #include "base/win/windows_version.h" | 44 #include "base/win/windows_version.h" |
45 #include "ui/aura/remote_window_tree_host_win.h" | 45 #include "ui/aura/remote_window_tree_host_win.h" |
46 #include "ui/aura/window_tree_host_win.h" | 46 #include "ui/aura/window_tree_host_win.h" |
47 #include "ui/platform_window/win/win_window.h" | |
48 #include "win8/test/test_registrar_constants.h" | 47 #include "win8/test/test_registrar_constants.h" |
49 #endif | 48 #endif |
50 | 49 |
51 #if defined(USE_X11) | 50 #if defined(USE_X11) |
52 #include "ui/gfx/x/x11_connection.h" | 51 #include "ui/gfx/x/x11_connection.h" |
53 #endif | 52 #endif |
54 | 53 |
55 namespace ash { | 54 namespace ash { |
56 namespace test { | 55 namespace test { |
57 namespace { | 56 namespace { |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 | 116 |
118 // TODO(jamescook): Can we do this without changing command line? | 117 // TODO(jamescook): Can we do this without changing command line? |
119 // Use the origin (1,1) so that it doesn't over | 118 // Use the origin (1,1) so that it doesn't over |
120 // lap with the native mouse cursor. | 119 // lap with the native mouse cursor. |
121 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 120 CommandLine* command_line = CommandLine::ForCurrentProcess(); |
122 if (!command_line->HasSwitch(switches::kAshHostWindowBounds)) { | 121 if (!command_line->HasSwitch(switches::kAshHostWindowBounds)) { |
123 command_line->AppendSwitchASCII( | 122 command_line->AppendSwitchASCII( |
124 switches::kAshHostWindowBounds, "1+1-800x600"); | 123 switches::kAshHostWindowBounds, "1+1-800x600"); |
125 } | 124 } |
126 #if defined(OS_WIN) | 125 #if defined(OS_WIN) |
127 ui::test::SetUsePopupAsRootWindowForTest(true); | 126 aura::test::SetUsePopupAsRootWindowForTest(true); |
128 #endif | 127 #endif |
129 ash_test_helper_->SetUp(start_session_); | 128 ash_test_helper_->SetUp(start_session_); |
130 | 129 |
131 Shell::GetPrimaryRootWindow()->Show(); | 130 Shell::GetPrimaryRootWindow()->Show(); |
132 Shell::GetPrimaryRootWindow()->GetHost()->Show(); | 131 Shell::GetPrimaryRootWindow()->GetHost()->Show(); |
133 // 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 |
134 // interfere test expectations. | 133 // interfere test expectations. |
135 Shell::GetPrimaryRootWindow()->MoveCursorTo(gfx::Point(-1000, -1000)); | 134 Shell::GetPrimaryRootWindow()->MoveCursorTo(gfx::Point(-1000, -1000)); |
136 ash::Shell::GetInstance()->cursor_manager()->EnableMouseEvents(); | 135 ash::Shell::GetInstance()->cursor_manager()->EnableMouseEvents(); |
137 | 136 |
(...skipping 29 matching lines...) Expand all Loading... |
167 if (base::win::GetVersion() >= base::win::VERSION_WIN8 && | 166 if (base::win::GetVersion() >= base::win::VERSION_WIN8 && |
168 !CommandLine::ForCurrentProcess()->HasSwitch( | 167 !CommandLine::ForCurrentProcess()->HasSwitch( |
169 ash::switches::kForceAshToDesktop)) { | 168 ash::switches::kForceAshToDesktop)) { |
170 // Check that our viewer connection is still established. | 169 // Check that our viewer connection is still established. |
171 CHECK(!metro_viewer_host_->closed_unexpectedly()); | 170 CHECK(!metro_viewer_host_->closed_unexpectedly()); |
172 } | 171 } |
173 #endif | 172 #endif |
174 | 173 |
175 ash_test_helper_->TearDown(); | 174 ash_test_helper_->TearDown(); |
176 #if defined(OS_WIN) | 175 #if defined(OS_WIN) |
177 ui::test::SetUsePopupAsRootWindowForTest(false); | 176 aura::test::SetUsePopupAsRootWindowForTest(false); |
178 // Kill the viewer process if we spun one up. | 177 // Kill the viewer process if we spun one up. |
179 metro_viewer_host_.reset(); | 178 metro_viewer_host_.reset(); |
180 | 179 |
181 // Clean up any dangling viewer processes as the metro APIs sometimes leave | 180 // Clean up any dangling viewer processes as the metro APIs sometimes leave |
182 // zombies behind. A default browser process in metro will have the | 181 // zombies behind. A default browser process in metro will have the |
183 // following command line arg so use that to avoid killing all processes named | 182 // following command line arg so use that to avoid killing all processes named |
184 // win8::test::kDefaultTestExePath. | 183 // win8::test::kDefaultTestExePath. |
185 const wchar_t kViewerProcessArgument[] = L"DefaultBrowserServer"; | 184 const wchar_t kViewerProcessArgument[] = L"DefaultBrowserServer"; |
186 base::KillAllNamedProcessesWithArgument(win8::test::kDefaultTestExePath, | 185 base::KillAllNamedProcessesWithArgument(win8::test::kDefaultTestExePath, |
187 kViewerProcessArgument); | 186 kViewerProcessArgument); |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
336 | 335 |
337 void AshTestBase::UnblockUserSession() { | 336 void AshTestBase::UnblockUserSession() { |
338 Shell::GetInstance()->session_state_delegate()->UnlockScreen(); | 337 Shell::GetInstance()->session_state_delegate()->UnlockScreen(); |
339 SetSessionStarted(true); | 338 SetSessionStarted(true); |
340 SetUserAddingScreenRunning(false); | 339 SetUserAddingScreenRunning(false); |
341 } | 340 } |
342 | 341 |
343 | 342 |
344 } // namespace test | 343 } // namespace test |
345 } // namespace ash | 344 } // namespace ash |
OLD | NEW |