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