| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/at_exit.h" | 5 #include "base/at_exit.h" |
| 6 #include "base/bind.h" | 6 #include "base/bind.h" |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/feature_list.h" | 8 #include "base/feature_list.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #if defined(OS_MACOSX) | 10 #if defined(OS_MACOSX) |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 | 27 |
| 28 int RunHelper(base::TestSuite* testSuite) { | 28 int RunHelper(base::TestSuite* testSuite) { |
| 29 #if defined(USE_OZONE) | 29 #if defined(USE_OZONE) |
| 30 base::MessageLoopForUI main_loop; | 30 base::MessageLoopForUI main_loop; |
| 31 #else | 31 #else |
| 32 base::MessageLoopForIO message_loop; | 32 base::MessageLoopForIO message_loop; |
| 33 #endif | 33 #endif |
| 34 base::FeatureList::InitializeInstance(std::string(), std::string()); | 34 base::FeatureList::InitializeInstance(std::string(), std::string()); |
| 35 gpu::GPUInfo gpu_info; | 35 gpu::GPUInfo gpu_info; |
| 36 gpu::CollectBasicGraphicsInfo(&gpu_info); | 36 gpu::CollectBasicGraphicsInfo(&gpu_info); |
| 37 gpu::ApplyGpuDriverBugWorkarounds(gpu_info, | 37 gpu::ApplyGpuDriverBugWorkarounds(gpu_info, std::string(), |
| 38 base::CommandLine::ForCurrentProcess()); | 38 base::CommandLine::ForCurrentProcess()); |
| 39 gl::init::InitializeGLOneOff(); | 39 gl::init::InitializeGLOneOff(); |
| 40 ::gles2::Initialize(); | 40 ::gles2::Initialize(); |
| 41 return testSuite->Run(); | 41 return testSuite->Run(); |
| 42 } | 42 } |
| 43 | 43 |
| 44 } // namespace | 44 } // namespace |
| 45 | 45 |
| 46 int main(int argc, char** argv) { | 46 int main(int argc, char** argv) { |
| 47 #if defined(OS_ANDROID) | 47 #if defined(OS_ANDROID) |
| 48 ui::gl::android::RegisterJni(base::android::AttachCurrentThread()); | 48 ui::gl::android::RegisterJni(base::android::AttachCurrentThread()); |
| 49 #endif | 49 #endif |
| 50 base::TestSuite test_suite(argc, argv); | 50 base::TestSuite test_suite(argc, argv); |
| 51 base::CommandLine::Init(argc, argv); | 51 base::CommandLine::Init(argc, argv); |
| 52 #if defined(OS_MACOSX) | 52 #if defined(OS_MACOSX) |
| 53 base::mac::ScopedNSAutoreleasePool pool; | 53 base::mac::ScopedNSAutoreleasePool pool; |
| 54 #endif | 54 #endif |
| 55 testing::InitGoogleMock(&argc, argv); | 55 testing::InitGoogleMock(&argc, argv); |
| 56 return base::LaunchUnitTestsSerially( | 56 return base::LaunchUnitTestsSerially( |
| 57 argc, | 57 argc, |
| 58 argv, | 58 argv, |
| 59 base::Bind(&RunHelper, base::Unretained(&test_suite))); | 59 base::Bind(&RunHelper, base::Unretained(&test_suite))); |
| 60 } | 60 } |
| OLD | NEW |