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

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

Issue 12588008: Add switch to run ash tests on desktop in windows 8. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 9 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/host/root_window_host_factory_win.cc ('k') | ash/test/test_suite.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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 116
117 Shell::GetPrimaryRootWindow()->Show(); 117 Shell::GetPrimaryRootWindow()->Show();
118 Shell::GetPrimaryRootWindow()->ShowRootWindow(); 118 Shell::GetPrimaryRootWindow()->ShowRootWindow();
119 // Move the mouse cursor to far away so that native events doesn't 119 // Move the mouse cursor to far away so that native events doesn't
120 // interfere test expectations. 120 // interfere test expectations.
121 Shell::GetPrimaryRootWindow()->MoveCursorTo(gfx::Point(-1000, -1000)); 121 Shell::GetPrimaryRootWindow()->MoveCursorTo(gfx::Point(-1000, -1000));
122 shell->cursor_manager()->EnableMouseEvents(); 122 shell->cursor_manager()->EnableMouseEvents();
123 ShellTestApi(shell).DisableOutputConfiguratorAnimation(); 123 ShellTestApi(shell).DisableOutputConfiguratorAnimation();
124 124
125 #if defined(OS_WIN) 125 #if defined(OS_WIN)
126 if (base::win::GetVersion() >= base::win::VERSION_WIN8) { 126 if (base::win::GetVersion() >= base::win::VERSION_WIN8 &&
127 !CommandLine::ForCurrentProcess()->HasSwitch(
128 ash::switches::kForceAshToDesktop)) {
127 metro_viewer_host_.reset(new TestMetroViewerProcessHost("viewer")); 129 metro_viewer_host_.reset(new TestMetroViewerProcessHost("viewer"));
128 ASSERT_TRUE( 130 ASSERT_TRUE(
129 metro_viewer_host_->LaunchViewerAndWaitForConnection( 131 metro_viewer_host_->LaunchViewerAndWaitForConnection(
130 win8::test::kDefaultTestAppUserModelId)); 132 win8::test::kDefaultTestAppUserModelId));
131 aura::RemoteRootWindowHostWin* root_window_host = 133 aura::RemoteRootWindowHostWin* root_window_host =
132 aura::RemoteRootWindowHostWin::Instance(); 134 aura::RemoteRootWindowHostWin::Instance();
133 ASSERT_TRUE(root_window_host != NULL); 135 ASSERT_TRUE(root_window_host != NULL);
134 } 136 }
135 #endif 137 #endif
136 } 138 }
137 139
138 void AshTestBase::TearDown() { 140 void AshTestBase::TearDown() {
139 // Flush the message loop to finish pending release tasks. 141 // Flush the message loop to finish pending release tasks.
140 RunAllPendingInMessageLoop(); 142 RunAllPendingInMessageLoop();
141 143
142 #if defined(OS_WIN) 144 #if defined(OS_WIN)
143 if (base::win::GetVersion() >= base::win::VERSION_WIN8) { 145 if (base::win::GetVersion() >= base::win::VERSION_WIN8 &&
146 !CommandLine::ForCurrentProcess()->HasSwitch(
147 ash::switches::kForceAshToDesktop)) {
144 // Check that our viewer connection is still established. 148 // Check that our viewer connection is still established.
145 ASSERT_FALSE(metro_viewer_host_->closed_unexpectedly()); 149 ASSERT_FALSE(metro_viewer_host_->closed_unexpectedly());
146 } 150 }
147 #endif 151 #endif
148 152
149 // Tear down the shell. 153 // Tear down the shell.
150 Shell::DeleteInstance(); 154 Shell::DeleteInstance();
151 155
152 #if defined(ENABLE_MESSAGE_CENTER) 156 #if defined(ENABLE_MESSAGE_CENTER)
153 // Remove global message center state. 157 // Remove global message center state.
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 void AshTestBase::SetUserLoggedIn(bool user_logged_in) { 277 void AshTestBase::SetUserLoggedIn(bool user_logged_in) {
274 test_shell_delegate_->SetUserLoggedIn(user_logged_in); 278 test_shell_delegate_->SetUserLoggedIn(user_logged_in);
275 } 279 }
276 280
277 void AshTestBase::SetCanLockScreen(bool can_lock_screen) { 281 void AshTestBase::SetCanLockScreen(bool can_lock_screen) {
278 test_shell_delegate_->SetCanLockScreen(can_lock_screen); 282 test_shell_delegate_->SetCanLockScreen(can_lock_screen);
279 } 283 }
280 284
281 } // namespace test 285 } // namespace test
282 } // namespace ash 286 } // namespace ash
OLDNEW
« no previous file with comments | « ash/host/root_window_host_factory_win.cc ('k') | ash/test/test_suite.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698