test_suite.cc revision 5821806d5e7f356e8fa4b058a389a808ea183019
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
3// found in the LICENSE file.
4
5#include "ui/compositor/test/test_suite.h"
6
7#include "base/message_loop.h"
8#include "ui/base/ui_base_paths.h"
9#include "ui/compositor/compositor.h"
10#include "ui/compositor/test/compositor_test_support.h"
11#include "ui/gfx/gfx_paths.h"
12#include "ui/gl/gl_implementation.h"
13
14namespace ui {
15namespace test {
16
17CompositorTestSuite::CompositorTestSuite(int argc, char** argv)
18    : TestSuite(argc, argv) {}
19
20CompositorTestSuite::~CompositorTestSuite() {}
21
22void CompositorTestSuite::Initialize() {
23#if defined(OS_LINUX)
24  gfx::InitializeGLBindings(gfx::kGLImplementationOSMesaGL);
25#endif
26  base::TestSuite::Initialize();
27
28  gfx::RegisterPathProvider();
29
30  message_loop_.reset(new MessageLoop(MessageLoop::TYPE_UI));
31  CompositorTestSupport::Initialize();
32  Compositor::Initialize(false);
33}
34
35void CompositorTestSuite::Shutdown() {
36  Compositor::Terminate();
37  CompositorTestSupport::Terminate();
38  message_loop_.reset();
39
40  base::TestSuite::Shutdown();
41}
42
43}  // namespace test
44}  // namespace ui
45