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/bind.h" | 5 #include "base/bind.h" |
6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
7 #include "base/test/launcher/unit_test_launcher.h" | 7 #include "base/test/launcher/unit_test_launcher.h" |
8 #include "base/test/test_io_thread.h" | 8 #include "base/test/test_io_thread.h" |
9 #include "base/test/test_suite.h" | 9 #include "base/test/test_suite.h" |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
11 #include "mojo/edk/embedder/embedder.h" | 11 #include "mojo/edk/embedder/embedder.h" |
12 | 12 |
13 #if defined(OS_ANDROID) | |
14 #include "gpu/ipc/client/android/in_process_surface_texture_manager.h" | |
15 #endif | |
16 | |
17 namespace { | 13 namespace { |
18 | 14 |
19 class GpuTestSuite : public base::TestSuite { | 15 class GpuTestSuite : public base::TestSuite { |
20 public: | 16 public: |
21 GpuTestSuite(int argc, char** argv); | 17 GpuTestSuite(int argc, char** argv); |
22 ~GpuTestSuite() override; | 18 ~GpuTestSuite() override; |
23 | 19 |
24 protected: | |
25 void Initialize() override; | |
26 | |
27 private: | 20 private: |
28 DISALLOW_COPY_AND_ASSIGN(GpuTestSuite); | 21 DISALLOW_COPY_AND_ASSIGN(GpuTestSuite); |
29 }; | 22 }; |
30 | 23 |
31 GpuTestSuite::GpuTestSuite(int argc, char** argv) | 24 GpuTestSuite::GpuTestSuite(int argc, char** argv) |
32 : base::TestSuite(argc, argv) {} | 25 : base::TestSuite(argc, argv) {} |
33 | 26 |
34 GpuTestSuite::~GpuTestSuite() {} | 27 GpuTestSuite::~GpuTestSuite() {} |
35 | 28 |
36 void GpuTestSuite::Initialize() { | |
37 base::TestSuite::Initialize(); | |
38 #if defined(OS_ANDROID) | |
39 gpu::SurfaceTextureManager::SetInstance( | |
40 gpu::InProcessSurfaceTextureManager::GetInstance()); | |
41 #endif | |
42 } | |
43 | |
44 } // namespace | 29 } // namespace |
45 | 30 |
46 int main(int argc, char** argv) { | 31 int main(int argc, char** argv) { |
47 base::CommandLine::Init(argc, argv); | 32 base::CommandLine::Init(argc, argv); |
48 GpuTestSuite test_suite(argc, argv); | 33 GpuTestSuite test_suite(argc, argv); |
49 | 34 |
50 mojo::edk::Init(); | 35 mojo::edk::Init(); |
51 | 36 |
52 return base::LaunchUnitTests( | 37 return base::LaunchUnitTests( |
53 argc, argv, | 38 argc, argv, |
54 base::Bind(&base::TestSuite::Run, base::Unretained(&test_suite))); | 39 base::Bind(&base::TestSuite::Run, base::Unretained(&test_suite))); |
55 } | 40 } |
OLD | NEW |