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_suite.h" | 5 #include "ui/gfx/compositor/test_suite.h" |
6 | 6 |
7 #include "base/message_loop.h" | |
8 #include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h" | |
9 #include "ui/base/resource/resource_bundle.h" | 7 #include "ui/base/resource/resource_bundle.h" |
10 #include "ui/base/ui_base_paths.h" | 8 #include "ui/base/ui_base_paths.h" |
11 #include "ui/gfx/compositor/compositor_test_support.h" | |
12 #include "ui/gfx/gfx_paths.h" | 9 #include "ui/gfx/gfx_paths.h" |
13 #include "ui/gfx/gl/gl_implementation.h" | 10 #include "ui/gfx/gl/gl_implementation.h" |
14 | 11 |
15 #if defined(USE_WEBKIT_COMPOSITOR) | |
16 #include "ui/gfx/compositor/compositor_cc.h" | |
17 #endif | |
18 | |
19 CompositorTestSuite::CompositorTestSuite(int argc, char** argv) | 12 CompositorTestSuite::CompositorTestSuite(int argc, char** argv) |
20 : TestSuite(argc, argv) {} | 13 : TestSuite(argc, argv) {} |
21 | 14 |
22 CompositorTestSuite::~CompositorTestSuite() {} | |
23 | |
24 void CompositorTestSuite::Initialize() { | 15 void CompositorTestSuite::Initialize() { |
25 #if defined(OS_LINUX) | 16 #if defined(OS_LINUX) |
26 gfx::InitializeGLBindings(gfx::kGLImplementationOSMesaGL); | 17 gfx::InitializeGLBindings(gfx::kGLImplementationOSMesaGL); |
27 #endif | 18 #endif |
28 base::TestSuite::Initialize(); | 19 base::TestSuite::Initialize(); |
29 | 20 |
30 gfx::RegisterPathProvider(); | 21 gfx::RegisterPathProvider(); |
31 ui::RegisterPathProvider(); | 22 ui::RegisterPathProvider(); |
32 | 23 |
33 // Force unittests to run using en-US so if we test against string | 24 // Force unittests to run using en-US so if we test against string |
34 // output, it'll pass regardless of the system language. | 25 // output, it'll pass regardless of the system language. |
35 ui::ResourceBundle::InitSharedInstance("en-US"); | 26 ui::ResourceBundle::InitSharedInstance("en-US"); |
36 | |
37 message_loop_.reset(new MessageLoop(MessageLoop::TYPE_UI)); | |
38 ui::CompositorTestSupport::Initialize(); | |
39 } | 27 } |
40 | 28 |
41 void CompositorTestSuite::Shutdown() { | 29 void CompositorTestSuite::Shutdown() { |
42 ui::CompositorTestSupport::Terminate(); | |
43 message_loop_.reset(); | |
44 | |
45 ui::ResourceBundle::CleanupSharedInstance(); | 30 ui::ResourceBundle::CleanupSharedInstance(); |
46 | 31 |
47 base::TestSuite::Shutdown(); | 32 base::TestSuite::Shutdown(); |
48 } | 33 } |
OLD | NEW |