Upstreaming browser/ui/uikit_ui_util from iOS.
[chromium-blink-merge.git] / gpu / command_buffer / common / unittest_main.cc
blob17b6114c13e48896ca960e4570c609e46120b44e
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 #include "base/test/launcher/unit_test_launcher.h"
10 #include "base/test/test_suite.h"
11 #include "testing/gmock/include/gmock/gmock.h"
12 #include "testing/gtest/include/gtest/gtest.h"
14 #if defined(OS_MACOSX)
15 #include "base/mac/scoped_nsautorelease_pool.h"
16 #endif
18 namespace {
20 class NoAtExitBaseTestSuite : public base::TestSuite {
21 public:
22 NoAtExitBaseTestSuite(int argc, char** argv)
23 : base::TestSuite(argc, argv, false) {
27 int RunTestSuite(int argc, char** argv) {
28 base::MessageLoop message_loop;
29 return NoAtExitBaseTestSuite(argc, argv).Run();
32 } // namespace
34 int main(int argc, char** argv) {
35 // On Android, AtExitManager is created in
36 // testing/android/native_test_wrapper.cc before main() is called.
37 // The same thing is also done in base/test/test_suite.cc
38 #if !defined(OS_ANDROID)
39 base::AtExitManager exit_manager;
40 #endif
41 base::CommandLine::Init(argc, argv);
42 #if defined(OS_MACOSX)
43 base::mac::ScopedNSAutoreleasePool autorelease_pool;
44 #endif
45 testing::InitGoogleMock(&argc, argv);
46 return base::LaunchUnitTests(argc,
47 argv,
48 base::Bind(&RunTestSuite, argc, argv));