| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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_HOST_MOCK_OBJECTS_H_ | 5 #ifndef REMOTING_HOST_HOST_MOCK_OBJECTS_H_ |
| 6 #define REMOTING_HOST_HOST_MOCK_OBJECTS_H_ | 6 #define REMOTING_HOST_HOST_MOCK_OBJECTS_H_ |
| 7 | 7 |
| 8 #include "net/base/ip_endpoint.h" | 8 #include "net/base/ip_endpoint.h" |
| 9 #include "remoting/base/capture_data.h" |
| 9 #include "remoting/host/video_frame_capturer.h" | 10 #include "remoting/host/video_frame_capturer.h" |
| 10 #include "remoting/host/chromoting_host_context.h" | 11 #include "remoting/host/chromoting_host_context.h" |
| 11 #include "remoting/host/client_session.h" | 12 #include "remoting/host/client_session.h" |
| 12 #include "remoting/host/continue_window.h" | 13 #include "remoting/host/continue_window.h" |
| 13 #include "remoting/host/desktop_environment.h" | 14 #include "remoting/host/desktop_environment.h" |
| 14 #include "remoting/host/desktop_environment_factory.h" | 15 #include "remoting/host/desktop_environment_factory.h" |
| 15 #include "remoting/host/disconnect_window.h" | 16 #include "remoting/host/disconnect_window.h" |
| 16 #include "remoting/host/event_executor.h" | 17 #include "remoting/host/event_executor.h" |
| 17 #include "remoting/host/host_status_observer.h" | 18 #include "remoting/host/host_status_observer.h" |
| 18 #include "remoting/host/local_input_monitor.h" | 19 #include "remoting/host/local_input_monitor.h" |
| 19 #include "remoting/host/user_authenticator.h" | 20 #include "remoting/host/user_authenticator.h" |
| 21 #include "remoting/proto/control.pb.h" |
| 20 #include "testing/gmock/include/gmock/gmock.h" | 22 #include "testing/gmock/include/gmock/gmock.h" |
| 21 | 23 |
| 22 namespace remoting { | 24 namespace remoting { |
| 23 | 25 |
| 24 class MockCaptureCompletedCallback { | |
| 25 public: | |
| 26 MockCaptureCompletedCallback(); | |
| 27 virtual ~MockCaptureCompletedCallback(); | |
| 28 | |
| 29 MOCK_METHOD1(CaptureCompletedPtr, void(CaptureData* capture_data)); | |
| 30 void CaptureCompleted(scoped_refptr<CaptureData> capture_data); | |
| 31 | |
| 32 private: | |
| 33 DISALLOW_COPY_AND_ASSIGN(MockCaptureCompletedCallback); | |
| 34 }; | |
| 35 | |
| 36 class MockVideoFrameCapturer : public VideoFrameCapturer { | 26 class MockVideoFrameCapturer : public VideoFrameCapturer { |
| 37 public: | 27 public: |
| 38 MockVideoFrameCapturer(); | 28 MockVideoFrameCapturer(); |
| 39 virtual ~MockVideoFrameCapturer(); | 29 virtual ~MockVideoFrameCapturer(); |
| 40 | 30 |
| 41 MOCK_METHOD1(Start, void(const CursorShapeChangedCallback& callback)); | 31 MOCK_METHOD1(Start, void(Delegate* delegate)); |
| 42 MOCK_METHOD0(Stop, void()); | 32 MOCK_METHOD0(Stop, void()); |
| 43 MOCK_CONST_METHOD0(pixel_format, media::VideoFrame::Format()); | 33 MOCK_CONST_METHOD0(pixel_format, media::VideoFrame::Format()); |
| 44 MOCK_METHOD1(InvalidateRegion, void(const SkRegion& invalid_region)); | 34 MOCK_METHOD1(InvalidateRegion, void(const SkRegion& invalid_region)); |
| 45 MOCK_METHOD1(CaptureInvalidRegion, | 35 MOCK_METHOD0(CaptureInvalidRegion, void()); |
| 46 void(const CaptureCompletedCallback& callback)); | |
| 47 MOCK_CONST_METHOD0(size_most_recent, const SkISize&()); | 36 MOCK_CONST_METHOD0(size_most_recent, const SkISize&()); |
| 48 | 37 |
| 49 private: | 38 private: |
| 50 DISALLOW_COPY_AND_ASSIGN(MockVideoFrameCapturer); | 39 DISALLOW_COPY_AND_ASSIGN(MockVideoFrameCapturer); |
| 51 }; | 40 }; |
| 52 | 41 |
| 42 class MockVideoFrameCapturerDelegate : public VideoFrameCapturer::Delegate { |
| 43 public: |
| 44 MockVideoFrameCapturerDelegate(); |
| 45 virtual ~MockVideoFrameCapturerDelegate(); |
| 46 |
| 47 virtual void OnCursorShapeChanged( |
| 48 scoped_ptr<protocol::CursorShapeInfo> cursor_shape) OVERRIDE; |
| 49 |
| 50 MOCK_METHOD1(OnCaptureCompleted, void(scoped_refptr<CaptureData>)); |
| 51 MOCK_METHOD1(OnCursorShapeChangedPtr, void(protocol::CursorShapeInfo*)); |
| 52 |
| 53 private: |
| 54 DISALLOW_COPY_AND_ASSIGN(MockVideoFrameCapturerDelegate); |
| 55 }; |
| 56 |
| 53 class MockDisconnectWindow : public DisconnectWindow { | 57 class MockDisconnectWindow : public DisconnectWindow { |
| 54 public: | 58 public: |
| 55 MockDisconnectWindow(); | 59 MockDisconnectWindow(); |
| 56 virtual ~MockDisconnectWindow(); | 60 virtual ~MockDisconnectWindow(); |
| 57 | 61 |
| 58 MOCK_METHOD3(Show, void(remoting::ChromotingHost* host, | 62 MOCK_METHOD3(Show, void(remoting::ChromotingHost* host, |
| 59 const DisconnectCallback& disconnect_callback, | 63 const DisconnectCallback& disconnect_callback, |
| 60 const std::string& username)); | 64 const std::string& username)); |
| 61 MOCK_METHOD0(Hide, void()); | 65 MOCK_METHOD0(Hide, void()); |
| 62 }; | 66 }; |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 MOCK_METHOD2(Authenticate, bool(const std::string& username, | 181 MOCK_METHOD2(Authenticate, bool(const std::string& username, |
| 178 const std::string& password)); | 182 const std::string& password)); |
| 179 | 183 |
| 180 private: | 184 private: |
| 181 DISALLOW_COPY_AND_ASSIGN(MockUserAuthenticator); | 185 DISALLOW_COPY_AND_ASSIGN(MockUserAuthenticator); |
| 182 }; | 186 }; |
| 183 | 187 |
| 184 } // namespace remoting | 188 } // namespace remoting |
| 185 | 189 |
| 186 #endif // REMOTING_HOST_HOST_MOCK_OBJECTS_H_ | 190 #endif // REMOTING_HOST_HOST_MOCK_OBJECTS_H_ |
| OLD | NEW |