| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 REMOTING_HOST_MOCK_OBJECTS_H_ | 5 #ifndef REMOTING_HOST_MOCK_OBJECTS_H_ |
| 6 #define REMOTING_HOST_MOCK_OBJECTS_H_ | 6 #define REMOTING_HOST_MOCK_OBJECTS_H_ |
| 7 | 7 |
| 8 #include "media/base/data_buffer.h" | 8 #include "media/base/data_buffer.h" |
| 9 #include "remoting/base/protocol_decoder.h" | 9 #include "remoting/base/protocol_decoder.h" |
| 10 #include "remoting/host/capturer.h" | 10 #include "remoting/host/capturer.h" |
| 11 #include "remoting/host/client_connection.h" | 11 #include "remoting/host/client_connection.h" |
| 12 #include "remoting/host/encoder.h" | 12 #include "remoting/host/encoder.h" |
| 13 #include "remoting/host/event_executor.h" | 13 #include "remoting/host/event_executor.h" |
| 14 #include "testing/gmock/include/gmock/gmock.h" | 14 #include "testing/gmock/include/gmock/gmock.h" |
| 15 | 15 |
| 16 namespace remoting { | 16 namespace remoting { |
| 17 | 17 |
| 18 class MockCapturer : public Capturer { | 18 class MockCapturer : public Capturer { |
| 19 public: | 19 public: |
| 20 MockCapturer() {} | 20 MockCapturer() {} |
| 21 | 21 |
| 22 MOCK_METHOD1(CaptureFullScreen, void(Task* done_task)); | 22 MOCK_METHOD1(CaptureFullScreen, void(Task* done_task)); |
| 23 MOCK_METHOD1(CaptureDirtyRects, void(Task* done_task)); | 23 MOCK_METHOD1(CaptureDirtyRects, void(Task* done_task)); |
| 24 MOCK_METHOD2(CaptureRect, void(const gfx::Rect& rect, Task* done_task)); | 24 MOCK_METHOD2(CaptureRect, void(const gfx::Rect& rect, Task* done_task)); |
| 25 MOCK_CONST_METHOD1(GetData, void(const uint8* planes[])); | 25 MOCK_CONST_METHOD1(GetData, void(const uint8* planes[])); |
| 26 MOCK_CONST_METHOD1(GetDataStride, void(int strides[])); | 26 MOCK_CONST_METHOD1(GetDataStride, void(int strides[])); |
| 27 MOCK_CONST_METHOD1(GetDirtyRects, void(DirtyRects* rects)); | 27 MOCK_CONST_METHOD1(GetDirtyRects, void(DirtyRects* rects)); |
| 28 MOCK_CONST_METHOD0(GetWidth, int()); | 28 MOCK_CONST_METHOD0(GetWidth, int()); |
| 29 MOCK_CONST_METHOD0(GetHeight, int()); | 29 MOCK_CONST_METHOD0(GetHeight, int()); |
| 30 MOCK_CONST_METHOD0(GetPixelFormat, chromotocol_pb::PixelFormat()); | 30 MOCK_CONST_METHOD0(GetPixelFormat, PixelFormat()); |
| 31 | 31 |
| 32 private: | 32 private: |
| 33 DISALLOW_COPY_AND_ASSIGN(MockCapturer); | 33 DISALLOW_COPY_AND_ASSIGN(MockCapturer); |
| 34 }; | 34 }; |
| 35 | 35 |
| 36 class MockEncoder : public Encoder { | 36 class MockEncoder : public Encoder { |
| 37 public: | 37 public: |
| 38 MockEncoder() {} | 38 MockEncoder() {} |
| 39 | 39 |
| 40 MOCK_METHOD8(Encode, void( | 40 MOCK_METHOD8(Encode, void( |
| 41 const DirtyRects& dirty_rects, | 41 const DirtyRects& dirty_rects, |
| 42 const uint8** planes, | 42 const uint8** planes, |
| 43 const int* strides, | 43 const int* strides, |
| 44 bool key_frame, | 44 bool key_frame, |
| 45 chromotocol_pb::UpdateStreamPacketHeader* output_data_header, | 45 UpdateStreamPacketHeader* output_data_header, |
| 46 scoped_refptr<media::DataBuffer>* output_data, | 46 scoped_refptr<media::DataBuffer>* output_data, |
| 47 bool* encode_done, | 47 bool* encode_done, |
| 48 Task* data_available_task)); | 48 Task* data_available_task)); |
| 49 MOCK_METHOD2(SetSize, void(int width, int height)); | 49 MOCK_METHOD2(SetSize, void(int width, int height)); |
| 50 MOCK_METHOD1(SetPixelFormat, void(chromotocol_pb::PixelFormat pixel_format)); | 50 MOCK_METHOD1(SetPixelFormat, void(PixelFormat pixel_format)); |
| 51 | 51 |
| 52 private: | 52 private: |
| 53 DISALLOW_COPY_AND_ASSIGN(MockEncoder); | 53 DISALLOW_COPY_AND_ASSIGN(MockEncoder); |
| 54 }; | 54 }; |
| 55 | 55 |
| 56 class MockEventExecutor : public EventExecutor { | 56 class MockEventExecutor : public EventExecutor { |
| 57 public: | 57 public: |
| 58 MockEventExecutor() {} | 58 MockEventExecutor() {} |
| 59 | 59 |
| 60 MOCK_METHOD1(HandleInputEvents, void(ClientMessageList* messages)); | 60 MOCK_METHOD1(HandleInputEvents, void(ClientMessageList* messages)); |
| 61 | 61 |
| 62 private: | 62 private: |
| 63 DISALLOW_COPY_AND_ASSIGN(MockEventExecutor); | 63 DISALLOW_COPY_AND_ASSIGN(MockEventExecutor); |
| 64 }; | 64 }; |
| 65 | 65 |
| 66 class MockClientConnection : public ClientConnection { | 66 class MockClientConnection : public ClientConnection { |
| 67 public: | 67 public: |
| 68 MockClientConnection(){} | 68 MockClientConnection(){} |
| 69 | 69 |
| 70 MOCK_METHOD2(SendInitClientMessage, void(int width, int height)); | 70 MOCK_METHOD2(SendInitClientMessage, void(int width, int height)); |
| 71 MOCK_METHOD0(SendBeginUpdateStreamMessage, void()); | 71 MOCK_METHOD0(SendBeginUpdateStreamMessage, void()); |
| 72 MOCK_METHOD2(SendUpdateStreamPacketMessage, | 72 MOCK_METHOD2(SendUpdateStreamPacketMessage, |
| 73 void(chromotocol_pb::UpdateStreamPacketHeader* header, | 73 void(UpdateStreamPacketHeader* header, |
| 74 scoped_refptr<media::DataBuffer> data)); | 74 scoped_refptr<media::DataBuffer> data)); |
| 75 MOCK_METHOD0(SendEndUpdateStreamMessage, void()); | 75 MOCK_METHOD0(SendEndUpdateStreamMessage, void()); |
| 76 MOCK_METHOD0(GetPendingUpdateStreamMessages, int()); | 76 MOCK_METHOD0(GetPendingUpdateStreamMessages, int()); |
| 77 | 77 |
| 78 MOCK_METHOD2(OnStateChange, void(JingleChannel* channel, | 78 MOCK_METHOD2(OnStateChange, void(JingleChannel* channel, |
| 79 JingleChannel::State state)); | 79 JingleChannel::State state)); |
| 80 MOCK_METHOD2(OnPacketReceived, void(JingleChannel* channel, | 80 MOCK_METHOD2(OnPacketReceived, void(JingleChannel* channel, |
| 81 scoped_refptr<media::DataBuffer> data)); | 81 scoped_refptr<media::DataBuffer> data)); |
| 82 | 82 |
| 83 private: | 83 private: |
| (...skipping 10 matching lines...) Expand all Loading... |
| 94 MOCK_METHOD1(OnConnectionClosed, void(ClientConnection* viewer)); | 94 MOCK_METHOD1(OnConnectionClosed, void(ClientConnection* viewer)); |
| 95 MOCK_METHOD1(OnConnectionFailed, void(ClientConnection* viewer)); | 95 MOCK_METHOD1(OnConnectionFailed, void(ClientConnection* viewer)); |
| 96 | 96 |
| 97 private: | 97 private: |
| 98 DISALLOW_COPY_AND_ASSIGN(MockClientConnectionEventHandler); | 98 DISALLOW_COPY_AND_ASSIGN(MockClientConnectionEventHandler); |
| 99 }; | 99 }; |
| 100 | 100 |
| 101 } // namespace remoting | 101 } // namespace remoting |
| 102 | 102 |
| 103 #endif // REMOTING_HOST_MOCK_OBJECTS_H_ | 103 #endif // REMOTING_HOST_MOCK_OBJECTS_H_ |
| OLD | NEW |