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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 DisableChangeDisplayUponHostResize(); | 112 DisableChangeDisplayUponHostResize(); |
113 | 113 |
114 Shell::GetPrimaryRootWindow()->Show(); | 114 Shell::GetPrimaryRootWindow()->Show(); |
115 Shell::GetPrimaryRootWindow()->ShowRootWindow(); | 115 Shell::GetPrimaryRootWindow()->ShowRootWindow(); |
116 // 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 |
117 // interfere test expectations. | 117 // interfere test expectations. |
118 Shell::GetPrimaryRootWindow()->MoveCursorTo(gfx::Point(-1000, -1000)); | 118 Shell::GetPrimaryRootWindow()->MoveCursorTo(gfx::Point(-1000, -1000)); |
119 shell->cursor_manager()->EnableMouseEvents(); | 119 shell->cursor_manager()->EnableMouseEvents(); |
120 | 120 |
121 #if defined(OS_WIN) | 121 #if defined(OS_WIN) |
122 if (base::win::GetVersion() >= base::win::VERSION_WIN8) { | 122 if (base::win::GetVersion() >= base::win::VERSION_WIN8 && |
| 123 !CommandLine::ForCurrentProcess()->HasSwitch( |
| 124 ash::switches::kForceAshToDesktop)) { |
123 metro_viewer_host_.reset(new TestMetroViewerProcessHost("viewer")); | 125 metro_viewer_host_.reset(new TestMetroViewerProcessHost("viewer")); |
124 ASSERT_TRUE( | 126 ASSERT_TRUE( |
125 metro_viewer_host_->LaunchViewerAndWaitForConnection( | 127 metro_viewer_host_->LaunchViewerAndWaitForConnection( |
126 win8::test::kDefaultTestAppUserModelId)); | 128 win8::test::kDefaultTestAppUserModelId)); |
127 aura::RemoteRootWindowHostWin* root_window_host = | 129 aura::RemoteRootWindowHostWin* root_window_host = |
128 aura::RemoteRootWindowHostWin::Instance(); | 130 aura::RemoteRootWindowHostWin::Instance(); |
129 ASSERT_TRUE(root_window_host != NULL); | 131 ASSERT_TRUE(root_window_host != NULL); |
130 } | 132 } |
131 #endif | 133 #endif |
132 } | 134 } |
133 | 135 |
134 void AshTestBase::TearDown() { | 136 void AshTestBase::TearDown() { |
135 // Flush the message loop to finish pending release tasks. | 137 // Flush the message loop to finish pending release tasks. |
136 RunAllPendingInMessageLoop(); | 138 RunAllPendingInMessageLoop(); |
137 | 139 |
138 #if defined(OS_WIN) | 140 #if defined(OS_WIN) |
139 if (base::win::GetVersion() >= base::win::VERSION_WIN8) { | 141 if (base::win::GetVersion() >= base::win::VERSION_WIN8 && |
| 142 !CommandLine::ForCurrentProcess()->HasSwitch( |
| 143 ash::switches::kForceAshToDesktop)) { |
140 // Check that our viewer connection is still established. | 144 // Check that our viewer connection is still established. |
141 ASSERT_FALSE(metro_viewer_host_->closed_unexpectedly()); | 145 ASSERT_FALSE(metro_viewer_host_->closed_unexpectedly()); |
142 } | 146 } |
143 #endif | 147 #endif |
144 | 148 |
145 // Tear down the shell. | 149 // Tear down the shell. |
146 Shell::DeleteInstance(); | 150 Shell::DeleteInstance(); |
147 | 151 |
148 #if defined(ENABLE_MESSAGE_CENTER) | 152 #if defined(ENABLE_MESSAGE_CENTER) |
149 // Remove global message center state. | 153 // Remove global message center state. |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 void AshTestBase::SetUserLoggedIn(bool user_logged_in) { | 273 void AshTestBase::SetUserLoggedIn(bool user_logged_in) { |
270 test_shell_delegate_->SetUserLoggedIn(user_logged_in); | 274 test_shell_delegate_->SetUserLoggedIn(user_logged_in); |
271 } | 275 } |
272 | 276 |
273 void AshTestBase::SetCanLockScreen(bool can_lock_screen) { | 277 void AshTestBase::SetCanLockScreen(bool can_lock_screen) { |
274 test_shell_delegate_->SetCanLockScreen(can_lock_screen); | 278 test_shell_delegate_->SetCanLockScreen(can_lock_screen); |
275 } | 279 } |
276 | 280 |
277 } // namespace test | 281 } // namespace test |
278 } // namespace ash | 282 } // namespace ash |
OLD | NEW |