| 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_delegate_aura.h" | 7 #include "ash/accelerators/accelerator_controller_delegate_aura.h" |
| 8 #include "ash/common/material_design/material_design_controller.h" | 8 #include "ash/common/material_design/material_design_controller.h" |
| 9 #include "ash/common/test/material_design_controller_test_api.h" | 9 #include "ash/common/test/material_design_controller_test_api.h" |
| 10 #include "ash/common/test/test_new_window_client.h" | 10 #include "ash/common/test/test_new_window_client.h" |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 test_screenshot_delegate_ = new TestScreenshotDelegate(); | 156 test_screenshot_delegate_ = new TestScreenshotDelegate(); |
| 157 shell->accelerator_controller_delegate()->SetScreenshotDelegate( | 157 shell->accelerator_controller_delegate()->SetScreenshotDelegate( |
| 158 std::unique_ptr<ScreenshotDelegate>(test_screenshot_delegate_)); | 158 std::unique_ptr<ScreenshotDelegate>(test_screenshot_delegate_)); |
| 159 | 159 |
| 160 WmShellTestApi().SetNewWindowClient(base::MakeUnique<TestNewWindowClient>()); | 160 WmShellTestApi().SetNewWindowClient(base::MakeUnique<TestNewWindowClient>()); |
| 161 } | 161 } |
| 162 | 162 |
| 163 void AshTestHelper::TearDown() { | 163 void AshTestHelper::TearDown() { |
| 164 // Tear down the shell. | 164 // Tear down the shell. |
| 165 Shell::DeleteInstance(); | 165 Shell::DeleteInstance(); |
| 166 |
| 167 // Suspend the tear down until all resources are returned via |
| 168 // MojoCompositorFrameSinkClient::ReclaimResources() |
| 169 RunAllPendingInMessageLoop(); |
| 166 material_design_state_.reset(); | 170 material_design_state_.reset(); |
| 167 test::MaterialDesignControllerTestAPI::Uninitialize(); | 171 test::MaterialDesignControllerTestAPI::Uninitialize(); |
| 168 ash_test_environment_->TearDown(); | 172 ash_test_environment_->TearDown(); |
| 169 | 173 |
| 170 test_screenshot_delegate_ = NULL; | 174 test_screenshot_delegate_ = NULL; |
| 171 | 175 |
| 172 // Remove global message center state. | 176 // Remove global message center state. |
| 173 message_center::MessageCenter::Shutdown(); | 177 message_center::MessageCenter::Shutdown(); |
| 174 | 178 |
| 175 #if defined(OS_CHROMEOS) | 179 #if defined(OS_CHROMEOS) |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 bool AshTestHelper::SupportsMultipleDisplays() { | 224 bool AshTestHelper::SupportsMultipleDisplays() { |
| 221 #if defined(OS_WIN) | 225 #if defined(OS_WIN) |
| 222 return false; | 226 return false; |
| 223 #else | 227 #else |
| 224 return true; | 228 return true; |
| 225 #endif | 229 #endif |
| 226 } | 230 } |
| 227 | 231 |
| 228 } // namespace test | 232 } // namespace test |
| 229 } // namespace ash | 233 } // namespace ash |
| OLD | NEW |