| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_helper.h" | 5 #include "ash/test/ash_test_helper.h" |
| 6 | 6 |
| 7 #include "ash/accelerators/accelerator_controller.h" | 7 #include "ash/accelerators/accelerator_controller.h" |
| 8 #include "ash/ash_switches.h" | 8 #include "ash/ash_switches.h" |
| 9 #include "ash/display/display_info.h" | 9 #include "ash/display/display_info.h" |
| 10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 #endif | 111 #endif |
| 112 ShellContentState* content_state = content_state_; | 112 ShellContentState* content_state = content_state_; |
| 113 if (!content_state) { | 113 if (!content_state) { |
| 114 test_shell_content_state_ = new TestShellContentState; | 114 test_shell_content_state_ = new TestShellContentState; |
| 115 content_state = test_shell_content_state_; | 115 content_state = test_shell_content_state_; |
| 116 } | 116 } |
| 117 ShellContentState::SetInstance(content_state); | 117 ShellContentState::SetInstance(content_state); |
| 118 | 118 |
| 119 // Reset the global state for the cursor manager. This includes the | 119 // Reset the global state for the cursor manager. This includes the |
| 120 // last cursor visibility state, etc. | 120 // last cursor visibility state, etc. |
| 121 wm::CursorManager::ResetCursorVisibilityStateForTest(); | 121 ::wm::CursorManager::ResetCursorVisibilityStateForTest(); |
| 122 | 122 |
| 123 // ContentTestSuiteBase might have already initialized | 123 // ContentTestSuiteBase might have already initialized |
| 124 // MaterialDesignController in unit_tests suite. | 124 // MaterialDesignController in unit_tests suite. |
| 125 ui::test::MaterialDesignControllerTestAPI::Uninitialize(); | 125 ui::test::MaterialDesignControllerTestAPI::Uninitialize(); |
| 126 ui::MaterialDesignController::Initialize(); | 126 ui::MaterialDesignController::Initialize(); |
| 127 ShellInitParams init_params; | 127 ShellInitParams init_params; |
| 128 init_params.delegate = test_shell_delegate_; | 128 init_params.delegate = test_shell_delegate_; |
| 129 init_params.context_factory = context_factory; | 129 init_params.context_factory = context_factory; |
| 130 init_params.blocking_pool = content::BrowserThread::GetBlockingPool(); | 130 init_params.blocking_pool = content::BrowserThread::GetBlockingPool(); |
| 131 ash::Shell::CreateInstance(init_params); | 131 ash::Shell::CreateInstance(init_params); |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 #endif | 169 #endif |
| 170 | 170 |
| 171 ui::TerminateContextFactoryForTests(); | 171 ui::TerminateContextFactoryForTests(); |
| 172 | 172 |
| 173 // Need to reset the initial login status. | 173 // Need to reset the initial login status. |
| 174 TestSystemTrayDelegate::SetInitialLoginStatus(user::LOGGED_IN_USER); | 174 TestSystemTrayDelegate::SetInitialLoginStatus(user::LOGGED_IN_USER); |
| 175 | 175 |
| 176 ui::ShutdownInputMethodForTesting(); | 176 ui::ShutdownInputMethodForTesting(); |
| 177 zero_duration_mode_.reset(); | 177 zero_duration_mode_.reset(); |
| 178 | 178 |
| 179 CHECK(!wm::ScopedCaptureClient::IsActive()); | 179 CHECK(!::wm::ScopedCaptureClient::IsActive()); |
| 180 | 180 |
| 181 views_delegate_.reset(); | 181 views_delegate_.reset(); |
| 182 } | 182 } |
| 183 | 183 |
| 184 void AshTestHelper::RunAllPendingInMessageLoop() { | 184 void AshTestHelper::RunAllPendingInMessageLoop() { |
| 185 DCHECK(base::MessageLoopForUI::current() == message_loop_); | 185 DCHECK(base::MessageLoopForUI::current() == message_loop_); |
| 186 base::RunLoop run_loop; | 186 base::RunLoop run_loop; |
| 187 run_loop.RunUntilIdle(); | 187 run_loop.RunUntilIdle(); |
| 188 } | 188 } |
| 189 | 189 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 215 bool AshTestHelper::SupportsHostWindowResize() { | 215 bool AshTestHelper::SupportsHostWindowResize() { |
| 216 #if defined(OS_WIN) | 216 #if defined(OS_WIN) |
| 217 return false; | 217 return false; |
| 218 #else | 218 #else |
| 219 return true; | 219 return true; |
| 220 #endif | 220 #endif |
| 221 } | 221 } |
| 222 | 222 |
| 223 } // namespace test | 223 } // namespace test |
| 224 } // namespace ash | 224 } // namespace ash |
| OLD | NEW |