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