OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/gfx/compositor/test/test_suite.h" | 5 #include "ui/gfx/compositor/test/test_suite.h" |
6 | 6 |
7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
8 #include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h" | 8 #include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h" |
9 #include "ui/base/resource/resource_bundle.h" | |
10 #include "ui/base/ui_base_paths.h" | 9 #include "ui/base/ui_base_paths.h" |
| 10 #include "ui/gfx/compositor/compositor_cc.h" |
11 #include "ui/gfx/compositor/test/compositor_test_support.h" | 11 #include "ui/gfx/compositor/test/compositor_test_support.h" |
12 #include "ui/gfx/gfx_paths.h" | 12 #include "ui/gfx/gfx_paths.h" |
13 #include "ui/gfx/gl/gl_implementation.h" | 13 #include "ui/gfx/gl/gl_implementation.h" |
14 | 14 |
15 #if defined(USE_WEBKIT_COMPOSITOR) | |
16 #include "ui/gfx/compositor/compositor_cc.h" | |
17 #endif | |
18 | |
19 CompositorTestSuite::CompositorTestSuite(int argc, char** argv) | 15 CompositorTestSuite::CompositorTestSuite(int argc, char** argv) |
20 : TestSuite(argc, argv) {} | 16 : TestSuite(argc, argv) {} |
21 | 17 |
22 CompositorTestSuite::~CompositorTestSuite() {} | 18 CompositorTestSuite::~CompositorTestSuite() {} |
23 | 19 |
24 void CompositorTestSuite::Initialize() { | 20 void CompositorTestSuite::Initialize() { |
25 #if defined(OS_LINUX) | 21 #if defined(OS_LINUX) |
26 gfx::InitializeGLBindings(gfx::kGLImplementationOSMesaGL); | 22 gfx::InitializeGLBindings(gfx::kGLImplementationOSMesaGL); |
27 #endif | 23 #endif |
28 base::TestSuite::Initialize(); | 24 base::TestSuite::Initialize(); |
29 | 25 |
30 gfx::RegisterPathProvider(); | 26 gfx::RegisterPathProvider(); |
31 ui::RegisterPathProvider(); | |
32 | 27 |
33 message_loop_.reset(new MessageLoop(MessageLoop::TYPE_UI)); | 28 message_loop_.reset(new MessageLoop(MessageLoop::TYPE_UI)); |
34 ui::CompositorTestSupport::Initialize(); | 29 ui::CompositorTestSupport::Initialize(); |
35 #if defined(USE_WEBKIT_COMPOSITOR) | |
36 ui::CompositorCC::Initialize(false); | 30 ui::CompositorCC::Initialize(false); |
37 #endif | |
38 } | 31 } |
39 | 32 |
40 void CompositorTestSuite::Shutdown() { | 33 void CompositorTestSuite::Shutdown() { |
41 #if defined(USE_WEBKIT_COMPOSITOR) | |
42 ui::CompositorCC::Terminate(); | 34 ui::CompositorCC::Terminate(); |
43 #endif | |
44 ui::CompositorTestSupport::Terminate(); | 35 ui::CompositorTestSupport::Terminate(); |
45 message_loop_.reset(); | 36 message_loop_.reset(); |
46 | 37 |
47 ui::ResourceBundle::CleanupSharedInstance(); | |
48 | |
49 base::TestSuite::Shutdown(); | 38 base::TestSuite::Shutdown(); |
50 } | 39 } |
OLD | NEW |