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 21 matching lines...) Expand all Loading... |
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) |
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" | |
43 #include "base/win/metro.h" | 42 #include "base/win/metro.h" |
44 #include "base/win/windows_version.h" | 43 #include "base/win/windows_version.h" |
45 #include "ui/aura/remote_window_tree_host_win.h" | 44 #include "ui/aura/remote_window_tree_host_win.h" |
46 #include "ui/aura/window_tree_host_win.h" | 45 #include "ui/aura/window_tree_host_win.h" |
47 #include "ui/platform_window/win/win_window.h" | 46 #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" |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 ui::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 if (metro_viewer_host_) { |
180 | 179 metro_viewer_host_->TerminateViewer(); |
181 // Clean up any dangling viewer processes as the metro APIs sometimes leave | 180 metro_viewer_host_.reset(); |
182 // zombies behind. A default browser process in metro will have the | 181 } |
183 // following command line arg so use that to avoid killing all processes named | |
184 // win8::test::kDefaultTestExePath. | |
185 const wchar_t kViewerProcessArgument[] = L"DefaultBrowserServer"; | |
186 base::KillAllNamedProcessesWithArgument(win8::test::kDefaultTestExePath, | |
187 kViewerProcessArgument); | |
188 #endif | 182 #endif |
189 | 183 |
190 event_generator_.reset(); | 184 event_generator_.reset(); |
191 // Some tests set an internal display id, | 185 // Some tests set an internal display id, |
192 // reset it here, so other tests will continue in a clean environment. | 186 // reset it here, so other tests will continue in a clean environment. |
193 gfx::Display::SetInternalDisplayId(gfx::Display::kInvalidDisplayID); | 187 gfx::Display::SetInternalDisplayId(gfx::Display::kInvalidDisplayID); |
194 } | 188 } |
195 | 189 |
196 ui::test::EventGenerator& AshTestBase::GetEventGenerator() { | 190 ui::test::EventGenerator& AshTestBase::GetEventGenerator() { |
197 if (!event_generator_) { | 191 if (!event_generator_) { |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
336 | 330 |
337 void AshTestBase::UnblockUserSession() { | 331 void AshTestBase::UnblockUserSession() { |
338 Shell::GetInstance()->session_state_delegate()->UnlockScreen(); | 332 Shell::GetInstance()->session_state_delegate()->UnlockScreen(); |
339 SetSessionStarted(true); | 333 SetSessionStarted(true); |
340 SetUserAddingScreenRunning(false); | 334 SetUserAddingScreenRunning(false); |
341 } | 335 } |
342 | 336 |
343 | 337 |
344 } // namespace test | 338 } // namespace test |
345 } // namespace ash | 339 } // namespace ash |
OLD | NEW |