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 "base/at_exit.h" 6#include "base/command_line.h" 7#include "base/message_loop/message_loop.h" 8#if defined(OS_MACOSX) 9#include "base/mac/scoped_nsautorelease_pool.h" 10#endif 11#include "gpu/command_buffer/client/gles2_lib.h" 12#include "gpu/command_buffer/tests/gl_test_utils.h" 13#include "gpu/config/gpu_util.h" 14#include "ui/gl/gl_surface.h" 15 16#if defined(OS_ANDROID) 17#include "base/android/jni_android.h" 18#include "ui/gl/android/gl_jni_registrar.h" 19#endif 20 21#if defined(TOOLKIT_GTK) 22#include "ui/gfx/gtk_util.h" 23#endif 24 25int main(int argc, char** argv) { 26#if defined(OS_ANDROID) 27 ui::gl::android::RegisterJni(base::android::AttachCurrentThread()); 28#else 29 base::AtExitManager exit_manager; 30#endif 31 CommandLine::Init(argc, argv); 32#if defined(OS_MACOSX) 33 base::mac::ScopedNSAutoreleasePool pool; 34#endif 35#if defined(TOOLKIT_GTK) 36 gfx::GtkInitFromCommandLine(*CommandLine::ForCurrentProcess()); 37#endif 38 gfx::GLSurface::InitializeOneOff(); 39 ::gles2::Initialize(); 40 gpu::ApplyGpuDriverBugWorkarounds(CommandLine::ForCurrentProcess()); 41 base::MessageLoop::Type message_loop_type = base::MessageLoop::TYPE_UI; 42 base::MessageLoop main_message_loop(message_loop_type); 43 return GLTestHelper::RunTests(argc, argv); 44} 45 46 47