OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #include "remoting/protocol/fake_connection_to_client.h" | |
6 | |
7 #include "remoting/protocol/session.h" | |
8 | |
9 namespace remoting { | |
10 namespace protocol { | |
11 | |
12 FakeConnectionToClient::FakeConnectionToClient(scoped_ptr<Session> session) | |
13 : session_(session.Pass()) {} | |
14 | |
15 FakeConnectionToClient::~FakeConnectionToClient() {} | |
16 | |
17 void FakeConnectionToClient::SetEventHandler(EventHandler* event_handler) { | |
18 event_handler_ = event_handler; | |
19 } | |
20 | |
21 VideoStub* FakeConnectionToClient::video_stub() { | |
22 return video_stub_; | |
23 } | |
24 | |
25 AudioStub* FakeConnectionToClient::audio_stub() { | |
26 return audio_stub_; | |
27 } | |
28 | |
29 ClientStub* FakeConnectionToClient::client_stub() { | |
30 return client_stub_; | |
31 } | |
32 | |
33 void FakeConnectionToClient::Disconnect(ErrorCode disconnect_error) { | |
34 if (is_connected_) { | |
Jamie
2015/11/24 00:38:09
Do we have tests that rely on being able to call t
Sergey Ulanov
2015/11/24 01:21:09
Good point. Replaced it with a CHECK(). There are
| |
35 is_connected_ = false; | |
36 disconnect_error_ = disconnect_error; | |
37 if (event_handler_) | |
38 event_handler_->OnConnectionClosed(this, disconnect_error_); | |
39 } | |
40 } | |
41 | |
42 Session* FakeConnectionToClient::session() { | |
43 return session_.get(); | |
44 } | |
45 | |
46 void FakeConnectionToClient::OnInputEventReceived(int64_t timestamp) {} | |
47 | |
48 void FakeConnectionToClient::set_clipboard_stub(ClipboardStub* clipboard_stub) { | |
49 clipboard_stub_ = clipboard_stub; | |
50 } | |
51 | |
52 void FakeConnectionToClient::set_host_stub(HostStub* host_stub) { | |
53 host_stub_ = host_stub; | |
54 } | |
55 | |
56 void FakeConnectionToClient::set_input_stub(InputStub* input_stub) { | |
57 input_stub_ = input_stub; | |
58 } | |
59 | |
60 void FakeConnectionToClient::set_video_feedback_stub( | |
61 VideoFeedbackStub* video_feedback_stub) { | |
62 video_feedback_stub_ = video_feedback_stub; | |
63 } | |
64 | |
65 } // namespace protocol | |
66 } // namespace remoting | |
OLD | NEW |