Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(609)

Side by Side Diff: ash/test/ash_test_base.cc

Issue 400413002: aura: Use PlatformWindow from WindowTreeHost. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: reland Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ash/ash.gyp ('k') | mojo/services/native_viewport/native_viewport_ozone.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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"
47 #include "win8/test/test_registrar_constants.h" 48 #include "win8/test/test_registrar_constants.h"
48 #endif 49 #endif
49 50
50 #if defined(USE_X11) 51 #if defined(USE_X11)
51 #include "ui/gfx/x/x11_connection.h" 52 #include "ui/gfx/x/x11_connection.h"
52 #endif 53 #endif
53 54
54 namespace ash { 55 namespace ash {
55 namespace test { 56 namespace test {
56 namespace { 57 namespace {
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 117
117 // TODO(jamescook): Can we do this without changing command line? 118 // TODO(jamescook): Can we do this without changing command line?
118 // Use the origin (1,1) so that it doesn't over 119 // Use the origin (1,1) so that it doesn't over
119 // lap with the native mouse cursor. 120 // lap with the native mouse cursor.
120 CommandLine* command_line = CommandLine::ForCurrentProcess(); 121 CommandLine* command_line = CommandLine::ForCurrentProcess();
121 if (!command_line->HasSwitch(switches::kAshHostWindowBounds)) { 122 if (!command_line->HasSwitch(switches::kAshHostWindowBounds)) {
122 command_line->AppendSwitchASCII( 123 command_line->AppendSwitchASCII(
123 switches::kAshHostWindowBounds, "1+1-800x600"); 124 switches::kAshHostWindowBounds, "1+1-800x600");
124 } 125 }
125 #if defined(OS_WIN) 126 #if defined(OS_WIN)
126 aura::test::SetUsePopupAsRootWindowForTest(true); 127 ui::test::SetUsePopupAsRootWindowForTest(true);
127 #endif 128 #endif
128 ash_test_helper_->SetUp(start_session_); 129 ash_test_helper_->SetUp(start_session_);
129 130
130 Shell::GetPrimaryRootWindow()->Show(); 131 Shell::GetPrimaryRootWindow()->Show();
131 Shell::GetPrimaryRootWindow()->GetHost()->Show(); 132 Shell::GetPrimaryRootWindow()->GetHost()->Show();
132 // Move the mouse cursor to far away so that native events doesn't 133 // Move the mouse cursor to far away so that native events doesn't
133 // interfere test expectations. 134 // interfere test expectations.
134 Shell::GetPrimaryRootWindow()->MoveCursorTo(gfx::Point(-1000, -1000)); 135 Shell::GetPrimaryRootWindow()->MoveCursorTo(gfx::Point(-1000, -1000));
135 ash::Shell::GetInstance()->cursor_manager()->EnableMouseEvents(); 136 ash::Shell::GetInstance()->cursor_manager()->EnableMouseEvents();
136 137
(...skipping 29 matching lines...) Expand all
166 if (base::win::GetVersion() >= base::win::VERSION_WIN8 && 167 if (base::win::GetVersion() >= base::win::VERSION_WIN8 &&
167 !CommandLine::ForCurrentProcess()->HasSwitch( 168 !CommandLine::ForCurrentProcess()->HasSwitch(
168 ash::switches::kForceAshToDesktop)) { 169 ash::switches::kForceAshToDesktop)) {
169 // Check that our viewer connection is still established. 170 // Check that our viewer connection is still established.
170 CHECK(!metro_viewer_host_->closed_unexpectedly()); 171 CHECK(!metro_viewer_host_->closed_unexpectedly());
171 } 172 }
172 #endif 173 #endif
173 174
174 ash_test_helper_->TearDown(); 175 ash_test_helper_->TearDown();
175 #if defined(OS_WIN) 176 #if defined(OS_WIN)
176 aura::test::SetUsePopupAsRootWindowForTest(false); 177 ui::test::SetUsePopupAsRootWindowForTest(false);
177 // Kill the viewer process if we spun one up. 178 // Kill the viewer process if we spun one up.
178 metro_viewer_host_.reset(); 179 metro_viewer_host_.reset();
179 180
180 // Clean up any dangling viewer processes as the metro APIs sometimes leave 181 // Clean up any dangling viewer processes as the metro APIs sometimes leave
181 // zombies behind. A default browser process in metro will have the 182 // zombies behind. A default browser process in metro will have the
182 // following command line arg so use that to avoid killing all processes named 183 // following command line arg so use that to avoid killing all processes named
183 // win8::test::kDefaultTestExePath. 184 // win8::test::kDefaultTestExePath.
184 const wchar_t kViewerProcessArgument[] = L"DefaultBrowserServer"; 185 const wchar_t kViewerProcessArgument[] = L"DefaultBrowserServer";
185 base::KillAllNamedProcessesWithArgument(win8::test::kDefaultTestExePath, 186 base::KillAllNamedProcessesWithArgument(win8::test::kDefaultTestExePath,
186 kViewerProcessArgument); 187 kViewerProcessArgument);
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 336
336 void AshTestBase::UnblockUserSession() { 337 void AshTestBase::UnblockUserSession() {
337 Shell::GetInstance()->session_state_delegate()->UnlockScreen(); 338 Shell::GetInstance()->session_state_delegate()->UnlockScreen();
338 SetSessionStarted(true); 339 SetSessionStarted(true);
339 SetUserAddingScreenRunning(false); 340 SetUserAddingScreenRunning(false);
340 } 341 }
341 342
342 343
343 } // namespace test 344 } // namespace test
344 } // namespace ash 345 } // namespace ash
OLDNEW
« no previous file with comments | « ash/ash.gyp ('k') | mojo/services/native_viewport/native_viewport_ozone.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698