OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef GPU_COMMAND_BUFFER_SERVICE_GPU_SERVICE_TEST_H_ | 5 #ifndef GPU_COMMAND_BUFFER_SERVICE_GPU_SERVICE_TEST_H_ |
6 #define GPU_COMMAND_BUFFER_SERVICE_GPU_SERVICE_TEST_H_ | 6 #define GPU_COMMAND_BUFFER_SERVICE_GPU_SERVICE_TEST_H_ |
7 | 7 |
| 8 #include <memory> |
| 9 |
8 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
9 #include "base/memory/scoped_ptr.h" | |
10 #include "base/message_loop/message_loop.h" | 11 #include "base/message_loop/message_loop.h" |
11 #include "testing/gmock/include/gmock/gmock.h" | 12 #include "testing/gmock/include/gmock/gmock.h" |
12 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
13 #include "ui/gl/gl_mock.h" | 14 #include "ui/gl/gl_mock.h" |
14 | 15 |
15 namespace gfx { | 16 namespace gfx { |
16 class GLContextStubWithExtensions; | 17 class GLContextStubWithExtensions; |
17 } | 18 } |
18 | 19 |
19 namespace gpu { | 20 namespace gpu { |
20 namespace gles2 { | 21 namespace gles2 { |
21 | 22 |
22 // Base class for tests that need mock GL bindings. | 23 // Base class for tests that need mock GL bindings. |
23 class GpuServiceTest : public testing::Test { | 24 class GpuServiceTest : public testing::Test { |
24 public: | 25 public: |
25 GpuServiceTest(); | 26 GpuServiceTest(); |
26 ~GpuServiceTest() override; | 27 ~GpuServiceTest() override; |
27 | 28 |
28 protected: | 29 protected: |
29 void SetUpWithGLVersion(const char* gl_version, const char* gl_extensions); | 30 void SetUpWithGLVersion(const char* gl_version, const char* gl_extensions); |
30 void SetUp() override; | 31 void SetUp() override; |
31 void TearDown() override; | 32 void TearDown() override; |
32 gfx::GLContext* GetGLContext(); | 33 gfx::GLContext* GetGLContext(); |
33 | 34 |
34 scoped_ptr< ::testing::StrictMock< ::gfx::MockGLInterface> > gl_; | 35 std::unique_ptr<::testing::StrictMock<::gfx::MockGLInterface>> gl_; |
35 | 36 |
36 private: | 37 private: |
37 bool ran_setup_; | 38 bool ran_setup_; |
38 bool ran_teardown_; | 39 bool ran_teardown_; |
39 scoped_refptr<gfx::GLContextStubWithExtensions> context_; | 40 scoped_refptr<gfx::GLContextStubWithExtensions> context_; |
40 base::MessageLoop message_loop_; | 41 base::MessageLoop message_loop_; |
41 }; | 42 }; |
42 | 43 |
43 } // namespace gles2 | 44 } // namespace gles2 |
44 } // namespace gpu | 45 } // namespace gpu |
45 | 46 |
46 #endif // GPU_COMMAND_BUFFER_SERVICE_GPU_SERVICE_TEST_H_ | 47 #endif // GPU_COMMAND_BUFFER_SERVICE_GPU_SERVICE_TEST_H_ |
OLD | NEW |