Index: gpu/command_buffer/common/unittest_main.cc |
diff --git a/gpu/command_buffer/common/unittest_main.cc b/gpu/command_buffer/common/unittest_main.cc |
index ed03dca8b6f2fee0183e3c7d29fb69f33875a7ca..6e907d5053392a4f94333a237bfc8626eb2d6fc0 100644 |
--- a/gpu/command_buffer/common/unittest_main.cc |
+++ b/gpu/command_buffer/common/unittest_main.cc |
@@ -3,11 +3,48 @@ |
// found in the LICENSE file. |
#include "base/bind.h" |
+#include "base/command_line.h" |
#include "base/test/launcher/unit_test_launcher.h" |
#include "base/test/test_suite.h" |
+#include "build/build_config.h" |
+ |
+#if defined(OS_ANDROID) |
+#include "gpu/ipc/client/android/in_process_surface_texture_manager.h" |
+#endif |
+ |
+namespace { |
+ |
+class GpuTestSuite : public base::TestSuite { |
+ public: |
+ GpuTestSuite(int argc, char** argv); |
+ ~GpuTestSuite() override; |
+ |
+ protected: |
+ void Initialize() override; |
+ |
+ private: |
+ DISALLOW_COPY_AND_ASSIGN(GpuTestSuite); |
+}; |
+ |
+GpuTestSuite::GpuTestSuite(int argc, char** argv) |
+ : base::TestSuite(argc, argv) {} |
+ |
+GpuTestSuite::~GpuTestSuite() {} |
+ |
+void GpuTestSuite::Initialize() { |
+ base::TestSuite::Initialize(); |
+#if defined(OS_ANDROID) |
+ gpu::SurfaceTextureManager::SetInstance( |
+ gpu::InProcessSurfaceTextureManager::GetInstance()); |
+#endif |
+} |
+ |
+} // namespace |
int main(int argc, char** argv) { |
- base::TestSuite test_suite(argc, argv); |
+ base::CommandLine::Init(argc, argv); |
+ GpuTestSuite test_suite(argc, argv); |
+ |
return base::LaunchUnitTests( |
argc, argv, |
base::Bind(&base::TestSuite::Run, base::Unretained(&test_suite))); |