OLD | NEW |
(Empty) | |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef GPU_COMMAND_BUFFER_CLIENT_IMAGE_FACTORY_MOCK_H_ |
| 6 #define GPU_COMMAND_BUFFER_CLIENT_IMAGE_FACTORY_MOCK_H_ |
| 7 |
| 8 #include "../client/gpu_memory_buffer.h" |
| 9 #include "../client/image_factory.h" |
| 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "gles2_impl_export.h" |
| 12 #include "testing/gmock/include/gmock/gmock.h" |
| 13 |
| 14 namespace gpu { |
| 15 namespace gles2 { |
| 16 class ImageManager; |
| 17 |
| 18 // Mock implementation of ImageFactory |
| 19 class GLES2_IMPL_EXPORT ImageFactoryMock : public ImageFactory { |
| 20 public: |
| 21 ImageFactoryMock(ImageManager* image_manager); |
| 22 virtual ~ImageFactoryMock(); |
| 23 |
| 24 MOCK_METHOD4(CreateGpuMemoryBufferMock, GpuMemoryBuffer*( |
| 25 int width, int height, GLenum internalformat, unsigned* image_id)); |
| 26 MOCK_METHOD1(DeleteGpuMemoryBuffer, void(unsigned)); |
| 27 // Workaround for mocking methods that return scoped_ptrs |
| 28 virtual scoped_ptr<GpuMemoryBuffer> CreateGpuMemoryBuffer( |
| 29 int width, int height, GLenum internalformat, |
| 30 unsigned* image_id) OVERRIDE { |
| 31 return scoped_ptr<GpuMemoryBuffer>(CreateGpuMemoryBufferMock( |
| 32 width, height, internalformat, image_id)); |
| 33 } |
| 34 |
| 35 private: |
| 36 DISALLOW_COPY_AND_ASSIGN(ImageFactoryMock); |
| 37 }; |
| 38 |
| 39 } // namespace gles2 |
| 40 } // namespace gpu |
| 41 |
| 42 #endif // GPU_COMMAND_BUFFER_CLIENT_IMAGE_FACTORY_MOCK_H_ |
OLD | NEW |