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