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.h" | 8 #include "base/message_loop.h" |
9 #include "ui/base/ui_base_paths.h" | 9 #include "ui/base/ui_base_paths.h" |
10 #include "ui/compositor/compositor.h" | 10 #include "ui/compositor/compositor.h" |
11 #include "ui/compositor/compositor_switches.h" | 11 #include "ui/compositor/compositor_switches.h" |
12 #include "ui/compositor/test/compositor_test_support.h" | |
13 #include "ui/gfx/gfx_paths.h" | 12 #include "ui/gfx/gfx_paths.h" |
14 #include "ui/gl/gl_implementation.h" | 13 #include "ui/gl/gl_implementation.h" |
15 | 14 |
16 #if defined(USE_X11) | 15 #if defined(USE_X11) |
17 #include <X11/Xlib.h> | 16 #include <X11/Xlib.h> |
18 #endif | 17 #endif |
19 | 18 |
20 namespace ui { | 19 namespace ui { |
21 namespace test { | 20 namespace test { |
22 | 21 |
23 CompositorTestSuite::CompositorTestSuite(int argc, char** argv) | 22 CompositorTestSuite::CompositorTestSuite(int argc, char** argv) |
24 : TestSuite(argc, argv) {} | 23 : TestSuite(argc, argv) {} |
25 | 24 |
26 CompositorTestSuite::~CompositorTestSuite() {} | 25 CompositorTestSuite::~CompositorTestSuite() {} |
27 | 26 |
28 void CompositorTestSuite::Initialize() { | 27 void CompositorTestSuite::Initialize() { |
29 #if defined(USE_X11) | 28 #if defined(USE_X11) |
30 XInitThreads(); | 29 XInitThreads(); |
31 #endif | 30 #endif |
32 #if defined(OS_LINUX) | 31 #if defined(OS_LINUX) |
33 gfx::InitializeGLBindings(gfx::kGLImplementationOSMesaGL); | 32 gfx::InitializeGLBindings(gfx::kGLImplementationOSMesaGL); |
34 #endif | 33 #endif |
35 base::TestSuite::Initialize(); | 34 base::TestSuite::Initialize(); |
36 | 35 |
37 gfx::RegisterPathProvider(); | 36 gfx::RegisterPathProvider(); |
38 | 37 |
39 message_loop_.reset(new base::MessageLoop(base::MessageLoop::TYPE_UI)); | 38 message_loop_.reset(new base::MessageLoop(base::MessageLoop::TYPE_UI)); |
40 CompositorTestSupport::Initialize(); | |
41 Compositor::Initialize(); | 39 Compositor::Initialize(); |
42 } | 40 } |
43 | 41 |
44 void CompositorTestSuite::Shutdown() { | 42 void CompositorTestSuite::Shutdown() { |
45 Compositor::Terminate(); | 43 Compositor::Terminate(); |
46 CompositorTestSupport::Terminate(); | |
47 message_loop_.reset(); | 44 message_loop_.reset(); |
48 | 45 |
49 base::TestSuite::Shutdown(); | 46 base::TestSuite::Shutdown(); |
50 } | 47 } |
51 | 48 |
52 } // namespace test | 49 } // namespace test |
53 } // namespace ui | 50 } // namespace ui |
OLD | NEW |