OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef UI_GL_ASYNC_TASK_DELEGATE_MOCK_H_ |
| 6 #define UI_GL_ASYNC_TASK_DELEGATE_MOCK_H_ |
| 7 |
| 8 #include "base/basictypes.h" |
| 9 #include "testing/gmock/include/gmock/gmock.h" |
| 10 #include "ui/gl/async_pixel_transfer_delegate.h" |
| 11 |
| 12 namespace gfx { |
| 13 |
| 14 class MockAsyncPixelTransferState : public gfx::AsyncPixelTransferState { |
| 15 public: |
| 16 MockAsyncPixelTransferState(); |
| 17 |
| 18 // Implement AsyncPixelTransferState. |
| 19 MOCK_METHOD0(TransferIsInProgress, bool()); |
| 20 MOCK_METHOD1(BindTransfer, void(AsyncTexImage2DParams* level_params)); |
| 21 |
| 22 protected: |
| 23 virtual ~MockAsyncPixelTransferState(); |
| 24 DISALLOW_COPY_AND_ASSIGN(MockAsyncPixelTransferState); |
| 25 }; |
| 26 |
| 27 class MockAsyncPixelTransferDelegate : public gfx::AsyncPixelTransferDelegate { |
| 28 public: |
| 29 MockAsyncPixelTransferDelegate(); |
| 30 virtual ~MockAsyncPixelTransferDelegate(); |
| 31 |
| 32 // Implement AsyncPixelTransferDelegate. |
| 33 MOCK_METHOD1(CreateRawPixelTransferState, |
| 34 gfx::AsyncPixelTransferState*(GLuint service_id)); |
| 35 MOCK_METHOD1(AsyncNotifyCompletion, |
| 36 void(const base::Closure& task)); |
| 37 MOCK_METHOD3(AsyncTexImage2D, |
| 38 void(gfx::AsyncPixelTransferState*, |
| 39 const AsyncTexImage2DParams& tex_params, |
| 40 const AsyncMemoryParams& mem_params)); |
| 41 MOCK_METHOD3(AsyncTexSubImage2D, |
| 42 void(gfx::AsyncPixelTransferState*, |
| 43 const AsyncTexSubImage2DParams& tex_params, |
| 44 const AsyncMemoryParams& mem_params)); |
| 45 |
| 46 // MOCK_METHOD wouldn't work, so redirect to CreateRawPixelTransferState. |
| 47 virtual scoped_ptr<AsyncPixelTransferState> |
| 48 CreatePixelTransferState(GLuint texture_id) OVERRIDE { |
| 49 return make_scoped_ptr(CreateRawPixelTransferState(texture_id)); |
| 50 } |
| 51 |
| 52 private: |
| 53 DISALLOW_COPY_AND_ASSIGN(MockAsyncPixelTransferDelegate); |
| 54 }; |
| 55 |
| 56 } // namespace gfx |
| 57 |
| 58 #endif // UI_GL_ASYNC_TASK_DELEGATE_MOCK_H_ |
| 59 |
OLD | NEW |