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 #include "remoting/protocol/fake_session.h" | 5 #include "remoting/protocol/fake_session.h" |
6 | 6 |
7 namespace remoting { | 7 namespace remoting { |
8 namespace protocol { | 8 namespace protocol { |
9 | 9 |
10 const char kTestJid[] = "host1@gmail.com/chromoting123"; | 10 const char kTestJid[] = "host1@gmail.com/chromoting123"; |
11 | 11 |
| 12 FakeTransportSession::FakeTransportSession() {} |
| 13 FakeTransportSession::~FakeTransportSession() {} |
| 14 |
| 15 void FakeTransportSession::Start(EventHandler* event_handler, |
| 16 Authenticator* authenticator) { |
| 17 NOTREACHED(); |
| 18 } |
| 19 |
| 20 bool FakeTransportSession::ProcessTransportInfo( |
| 21 buzz::XmlElement* transport_info) { |
| 22 NOTREACHED(); |
| 23 return true; |
| 24 } |
| 25 |
| 26 DatagramChannelFactory* FakeTransportSession::GetDatagramChannelFactory() { |
| 27 NOTIMPLEMENTED(); |
| 28 return nullptr; |
| 29 } |
| 30 |
| 31 FakeStreamChannelFactory* FakeTransportSession::GetStreamChannelFactory() { |
| 32 return &channel_factory_; |
| 33 } |
| 34 |
| 35 FakeStreamChannelFactory* FakeTransportSession::GetMultiplexedChannelFactory() { |
| 36 return &channel_factory_; |
| 37 } |
| 38 |
12 FakeSession::FakeSession() | 39 FakeSession::FakeSession() |
13 : event_handler_(nullptr), | 40 : event_handler_(nullptr), |
14 config_(SessionConfig::ForTest()), | 41 config_(SessionConfig::ForTest()), |
15 jid_(kTestJid), | 42 jid_(kTestJid), |
16 error_(OK), | 43 error_(OK), |
17 closed_(false) {} | 44 closed_(false) {} |
18 | 45 |
19 FakeSession::~FakeSession() {} | 46 FakeSession::~FakeSession() {} |
20 | 47 |
21 void FakeSession::SetEventHandler(EventHandler* event_handler) { | 48 void FakeSession::SetEventHandler(EventHandler* event_handler) { |
22 event_handler_ = event_handler; | 49 event_handler_ = event_handler; |
23 } | 50 } |
24 | 51 |
25 ErrorCode FakeSession::error() { | 52 ErrorCode FakeSession::error() { |
26 return error_; | 53 return error_; |
27 } | 54 } |
28 | 55 |
29 const std::string& FakeSession::jid() { | 56 const std::string& FakeSession::jid() { |
30 return jid_; | 57 return jid_; |
31 } | 58 } |
32 | 59 |
33 const SessionConfig& FakeSession::config() { | 60 const SessionConfig& FakeSession::config() { |
34 return *config_; | 61 return *config_; |
35 } | 62 } |
36 | 63 |
37 StreamChannelFactory* FakeSession::GetTransportChannelFactory() { | 64 FakeTransportSession* FakeSession::GetTransportSession() { |
38 return &channel_factory_; | 65 return &transport_session_; |
39 } | 66 } |
40 | 67 |
41 StreamChannelFactory* FakeSession::GetMultiplexedChannelFactory() { | 68 FakeStreamChannelFactory* FakeSession::GetQuicChannelFactory() { |
42 return &channel_factory_; | 69 return transport_session_.GetStreamChannelFactory(); |
43 } | |
44 | |
45 StreamChannelFactory* FakeSession::GetQuicChannelFactory() { | |
46 return &channel_factory_; | |
47 } | 70 } |
48 | 71 |
49 void FakeSession::Close() { | 72 void FakeSession::Close() { |
50 closed_ = true; | 73 closed_ = true; |
51 } | 74 } |
52 | 75 |
53 } // namespace protocol | 76 } // namespace protocol |
54 } // namespace remoting | 77 } // namespace remoting |
OLD | NEW |