| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_PROTOCOL_FAKE_CONNECTION_TO_CLIENT_H_ | 5 #ifndef REMOTING_PROTOCOL_FAKE_CONNECTION_TO_CLIENT_H_ |
| 6 #define REMOTING_PROTOCOL_FAKE_CONNECTION_TO_CLIENT_H_ | 6 #define REMOTING_PROTOCOL_FAKE_CONNECTION_TO_CLIENT_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 | 46 |
| 47 class FakeConnectionToClient : public ConnectionToClient { | 47 class FakeConnectionToClient : public ConnectionToClient { |
| 48 public: | 48 public: |
| 49 FakeConnectionToClient(std::unique_ptr<Session> session); | 49 FakeConnectionToClient(std::unique_ptr<Session> session); |
| 50 ~FakeConnectionToClient() override; | 50 ~FakeConnectionToClient() override; |
| 51 | 51 |
| 52 void SetEventHandler(EventHandler* event_handler) override; | 52 void SetEventHandler(EventHandler* event_handler) override; |
| 53 | 53 |
| 54 std::unique_ptr<VideoStream> StartVideoStream( | 54 std::unique_ptr<VideoStream> StartVideoStream( |
| 55 std::unique_ptr<webrtc::DesktopCapturer> desktop_capturer) override; | 55 std::unique_ptr<webrtc::DesktopCapturer> desktop_capturer) override; |
| 56 std::unique_ptr<AudioStream> StartAudioStream( |
| 57 std::unique_ptr<AudioSource> audio_source) override; |
| 56 | 58 |
| 57 AudioStub* audio_stub() override; | |
| 58 ClientStub* client_stub() override; | 59 ClientStub* client_stub() override; |
| 59 void Disconnect(ErrorCode disconnect_error) override; | 60 void Disconnect(ErrorCode disconnect_error) override; |
| 60 | 61 |
| 61 Session* session() override; | 62 Session* session() override; |
| 62 void OnInputEventReceived(int64_t timestamp) override; | 63 void OnInputEventReceived(int64_t timestamp) override; |
| 63 | 64 |
| 64 void set_clipboard_stub(ClipboardStub* clipboard_stub) override; | 65 void set_clipboard_stub(ClipboardStub* clipboard_stub) override; |
| 65 void set_host_stub(HostStub* host_stub) override; | 66 void set_host_stub(HostStub* host_stub) override; |
| 66 void set_input_stub(InputStub* input_stub) override; | 67 void set_input_stub(InputStub* input_stub) override; |
| 67 | 68 |
| 68 base::WeakPtr<FakeVideoStream> last_video_stream() { | 69 base::WeakPtr<FakeVideoStream> last_video_stream() { |
| 69 return last_video_stream_; | 70 return last_video_stream_; |
| 70 } | 71 } |
| 71 | 72 |
| 72 void set_audio_stub(AudioStub* audio_stub) { audio_stub_ = audio_stub; } | |
| 73 void set_client_stub(ClientStub* client_stub) { client_stub_ = client_stub; } | 73 void set_client_stub(ClientStub* client_stub) { client_stub_ = client_stub; } |
| 74 void set_video_stub(VideoStub* video_stub) { video_stub_ = video_stub; } | 74 void set_video_stub(VideoStub* video_stub) { video_stub_ = video_stub; } |
| 75 void set_video_encode_task_runner( | 75 void set_video_encode_task_runner( |
| 76 scoped_refptr<base::SingleThreadTaskRunner> runner) { | 76 scoped_refptr<base::SingleThreadTaskRunner> runner) { |
| 77 video_encode_task_runner_ = runner; | 77 video_encode_task_runner_ = runner; |
| 78 } | 78 } |
| 79 | 79 |
| 80 EventHandler* event_handler() { return event_handler_; } | 80 EventHandler* event_handler() { return event_handler_; } |
| 81 ClipboardStub* clipboard_stub() { return clipboard_stub_; } | 81 ClipboardStub* clipboard_stub() { return clipboard_stub_; } |
| 82 HostStub* host_stub() { return host_stub_; } | 82 HostStub* host_stub() { return host_stub_; } |
| 83 InputStub* input_stub() { return input_stub_; } | 83 InputStub* input_stub() { return input_stub_; } |
| 84 VideoStub* video_stub() { return video_stub_; } | 84 VideoStub* video_stub() { return video_stub_; } |
| 85 VideoFeedbackStub* video_feedback_stub() { return video_feedback_stub_; } | 85 VideoFeedbackStub* video_feedback_stub() { return video_feedback_stub_; } |
| 86 | 86 |
| 87 bool is_connected() { return is_connected_; } | 87 bool is_connected() { return is_connected_; } |
| 88 ErrorCode disconnect_error() { return disconnect_error_; } | 88 ErrorCode disconnect_error() { return disconnect_error_; } |
| 89 | 89 |
| 90 private: | 90 private: |
| 91 std::unique_ptr<Session> session_; | 91 std::unique_ptr<Session> session_; |
| 92 EventHandler* event_handler_ = nullptr; | 92 EventHandler* event_handler_ = nullptr; |
| 93 | 93 |
| 94 base::WeakPtr<FakeVideoStream> last_video_stream_; | 94 base::WeakPtr<FakeVideoStream> last_video_stream_; |
| 95 | 95 |
| 96 AudioStub* audio_stub_ = nullptr; | |
| 97 ClientStub* client_stub_ = nullptr; | 96 ClientStub* client_stub_ = nullptr; |
| 98 | 97 |
| 99 ClipboardStub* clipboard_stub_ = nullptr; | 98 ClipboardStub* clipboard_stub_ = nullptr; |
| 100 HostStub* host_stub_ = nullptr; | 99 HostStub* host_stub_ = nullptr; |
| 101 InputStub* input_stub_ = nullptr; | 100 InputStub* input_stub_ = nullptr; |
| 102 VideoStub* video_stub_ = nullptr; | 101 VideoStub* video_stub_ = nullptr; |
| 103 VideoFeedbackStub* video_feedback_stub_ = nullptr; | 102 VideoFeedbackStub* video_feedback_stub_ = nullptr; |
| 104 | 103 |
| 105 scoped_refptr<base::SingleThreadTaskRunner> video_encode_task_runner_; | 104 scoped_refptr<base::SingleThreadTaskRunner> video_encode_task_runner_; |
| 106 | 105 |
| 107 bool is_connected_ = true; | 106 bool is_connected_ = true; |
| 108 ErrorCode disconnect_error_ = OK; | 107 ErrorCode disconnect_error_ = OK; |
| 109 | 108 |
| 110 DISALLOW_COPY_AND_ASSIGN(FakeConnectionToClient); | 109 DISALLOW_COPY_AND_ASSIGN(FakeConnectionToClient); |
| 111 }; | 110 }; |
| 112 | 111 |
| 113 } // namespace protocol | 112 } // namespace protocol |
| 114 } // namespace remoting | 113 } // namespace remoting |
| 115 | 114 |
| 116 #endif // REMOTING_PROTOCOL_FAKE_CONNECTION_TO_CLIENT_H_ | 115 #endif // REMOTING_PROTOCOL_FAKE_CONNECTION_TO_CLIENT_H_ |
| OLD | NEW |