Rewrite AndroidSyncSettings to be significantly simpler.
[chromium-blink-merge.git] / gpu / command_buffer / tests / gl_tests_main.cc
blob7b7d8d86ec25bae20b598c517991b0fa637bca28
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/bind.h"
7 #include "base/command_line.h"
8 #include "base/message_loop/message_loop.h"
9 #if defined(OS_MACOSX)
10 #include "base/mac/scoped_nsautorelease_pool.h"
11 #endif
12 #include "base/test/launcher/unit_test_launcher.h"
13 #include "base/test/test_suite.h"
14 #include "gpu/command_buffer/client/gles2_lib.h"
15 #include "gpu/config/gpu_util.h"
16 #include "testing/gmock/include/gmock/gmock.h"
17 #include "ui/gl/gl_surface.h"
19 #if defined(OS_ANDROID)
20 #include "base/android/jni_android.h"
21 #include "ui/gl/android/gl_jni_registrar.h"
22 #endif
24 namespace {
26 int RunHelper(base::TestSuite* testSuite) {
27 base::MessageLoopForIO message_loop;
28 return testSuite->Run();
31 } // namespace
33 int main(int argc, char** argv) {
34 #if defined(OS_ANDROID)
35 ui::gl::android::RegisterJni(base::android::AttachCurrentThread());
36 #endif
37 base::TestSuite test_suite(argc, argv);
38 base::CommandLine::Init(argc, argv);
39 #if defined(OS_MACOSX)
40 base::mac::ScopedNSAutoreleasePool pool;
41 #endif
42 gfx::GLSurface::InitializeOneOff();
43 ::gles2::Initialize();
44 gpu::ApplyGpuDriverBugWorkarounds(base::CommandLine::ForCurrentProcess());
45 testing::InitGoogleMock(&argc, argv);
46 return base::LaunchUnitTestsSerially(
47 argc,
48 argv,
49 base::Bind(&RunHelper, base::Unretained(&test_suite)));