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 "ui/compositor/test/test_suite.h" | 5 #include "ui/compositor/test/test_suite.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/memory/ptr_util.h" |
| 9 #include "base/test/scoped_task_environment.h" |
9 #include "build/build_config.h" | 10 #include "build/build_config.h" |
10 #include "ui/compositor/compositor.h" | 11 #include "ui/compositor/compositor.h" |
11 #include "ui/compositor/compositor_switches.h" | 12 #include "ui/compositor/compositor_switches.h" |
12 #include "ui/compositor/layer.h" | 13 #include "ui/compositor/layer.h" |
13 #include "ui/gfx/gfx_paths.h" | 14 #include "ui/gfx/gfx_paths.h" |
14 #include "ui/gl/test/gl_surface_test_support.h" | 15 #include "ui/gl/test/gl_surface_test_support.h" |
15 | 16 |
16 #if defined(USE_OZONE) | 17 #if defined(USE_OZONE) |
17 #include "ui/ozone/public/ozone_platform.h" | 18 #include "ui/ozone/public/ozone_platform.h" |
18 #endif | 19 #endif |
(...skipping 17 matching lines...) Expand all Loading... |
36 #if defined(USE_OZONE) | 37 #if defined(USE_OZONE) |
37 ui::OzonePlatform::InitializeForUI(); | 38 ui::OzonePlatform::InitializeForUI(); |
38 #endif | 39 #endif |
39 | 40 |
40 gfx::RegisterPathProvider(); | 41 gfx::RegisterPathProvider(); |
41 | 42 |
42 #if defined(OS_WIN) | 43 #if defined(OS_WIN) |
43 display::win::SetDefaultDeviceScaleFactor(1.0f); | 44 display::win::SetDefaultDeviceScaleFactor(1.0f); |
44 #endif | 45 #endif |
45 | 46 |
46 message_loop_.reset(new base::MessageLoopForUI); | 47 scoped_task_environment_ = |
| 48 base::MakeUnique<base::test::ScopedTaskEnvironment>( |
| 49 base::test::ScopedTaskEnvironment::MainThreadType::UI); |
47 } | 50 } |
48 | 51 |
49 void CompositorTestSuite::Shutdown() { | 52 void CompositorTestSuite::Shutdown() { |
50 message_loop_.reset(); | 53 scoped_task_environment_.reset(); |
51 | 54 |
52 base::TestSuite::Shutdown(); | 55 base::TestSuite::Shutdown(); |
53 } | 56 } |
54 | 57 |
55 } // namespace test | 58 } // namespace test |
56 } // namespace ui | 59 } // namespace ui |
OLD | NEW |