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.
5 #include "base/at_exit.h"
6 #include "base/command_line.h"
7 #include "base/message_loop/message_loop.h"
9 #include "base/mac/scoped_nsautorelease_pool.h"
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"
16 #if defined(OS_ANDROID)
17 #include "base/android/jni_android.h"
18 #include "ui/gl/android/gl_jni_registrar.h"
21 int main(int argc
, char** argv
) {
22 #if defined(OS_ANDROID)
23 ui::gl::android::RegisterJni(base::android::AttachCurrentThread());
25 base::AtExitManager exit_manager
;
27 CommandLine::Init(argc
, argv
);
28 #if defined(OS_MACOSX)
29 base::mac::ScopedNSAutoreleasePool pool
;
31 gfx::GLSurface::InitializeOneOff();
32 ::gles2::Initialize();
33 gpu::ApplyGpuDriverBugWorkarounds(CommandLine::ForCurrentProcess());
34 base::MessageLoop main_message_loop
;
35 return GLTestHelper::RunTests(argc
, argv
);