| 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 Shell::GetPrimaryRootWindow()->ShowRootWindow(); | 112 Shell::GetPrimaryRootWindow()->ShowRootWindow(); |
| 113 // Move the mouse cursor to far away so that native events doesn't | 113 // Move the mouse cursor to far away so that native events doesn't |
| 114 // interfere test expectations. | 114 // interfere test expectations. |
| 115 Shell::GetPrimaryRootWindow()->MoveCursorTo(gfx::Point(-1000, -1000)); | 115 Shell::GetPrimaryRootWindow()->MoveCursorTo(gfx::Point(-1000, -1000)); |
| 116 ash::Shell::GetInstance()->cursor_manager()->EnableMouseEvents(); | 116 ash::Shell::GetInstance()->cursor_manager()->EnableMouseEvents(); |
| 117 | 117 |
| 118 #if defined(OS_WIN) | 118 #if defined(OS_WIN) |
| 119 if (base::win::GetVersion() >= base::win::VERSION_WIN8 && | 119 if (base::win::GetVersion() >= base::win::VERSION_WIN8 && |
| 120 !CommandLine::ForCurrentProcess()->HasSwitch( | 120 !CommandLine::ForCurrentProcess()->HasSwitch( |
| 121 ash::switches::kForceAshToDesktop)) { | 121 ash::switches::kForceAshToDesktop)) { |
| 122 ipc_thread_.reset(new base::Thread("test_metro_viewer_ipc_thread")); | 122 metro_viewer_host_.reset(new TestMetroViewerProcessHost("viewer")); |
| 123 base::Thread::Options options; | |
| 124 options.message_loop_type = base::MessageLoop::TYPE_IO; | |
| 125 ipc_thread_->StartWithOptions(options); | |
| 126 | |
| 127 metro_viewer_host_.reset( | |
| 128 new TestMetroViewerProcessHost("viewer", | |
| 129 ipc_thread_->message_loop_proxy())); | |
| 130 CHECK(metro_viewer_host_->LaunchViewerAndWaitForConnection( | 123 CHECK(metro_viewer_host_->LaunchViewerAndWaitForConnection( |
| 131 win8::test::kDefaultTestAppUserModelId)); | 124 win8::test::kDefaultTestAppUserModelId)); |
| 132 aura::RemoteRootWindowHostWin* root_window_host = | 125 aura::RemoteRootWindowHostWin* root_window_host = |
| 133 aura::RemoteRootWindowHostWin::Instance(); | 126 aura::RemoteRootWindowHostWin::Instance(); |
| 134 CHECK(root_window_host != NULL); | 127 CHECK(root_window_host != NULL); |
| 135 } | 128 } |
| 136 #endif | 129 #endif |
| 137 } | 130 } |
| 138 | 131 |
| 139 void AshTestBase::TearDown() { | 132 void AshTestBase::TearDown() { |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 SetHasActiveUser(user_logged_in); | 256 SetHasActiveUser(user_logged_in); |
| 264 } | 257 } |
| 265 | 258 |
| 266 void AshTestBase::SetCanLockScreen(bool can_lock_screen) { | 259 void AshTestBase::SetCanLockScreen(bool can_lock_screen) { |
| 267 ash_test_helper_->test_shell_delegate()->test_session_state_delegate()-> | 260 ash_test_helper_->test_shell_delegate()->test_session_state_delegate()-> |
| 268 SetCanLockScreen(can_lock_screen); | 261 SetCanLockScreen(can_lock_screen); |
| 269 } | 262 } |
| 270 | 263 |
| 271 } // namespace test | 264 } // namespace test |
| 272 } // namespace ash | 265 } // namespace ash |
| OLD | NEW |