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
3 // found in the LICENSE file.
5 #ifndef REMOTING_PROTOCOL_FAKE_SESSION_H_
6 #define REMOTING_PROTOCOL_FAKE_SESSION_H_
12 #include "base/memory/scoped_ptr.h"
13 #include "remoting/protocol/fake_stream_socket.h"
14 #include "remoting/protocol/session.h"
19 extern const char kTestJid[];
21 // FakeSession is a dummy protocol::Session that uses FakeStreamSocket for all
23 class FakeSession : public Session {
26 virtual ~FakeSession();
28 EventHandler* event_handler() { return event_handler_; }
30 void set_error(ErrorCode error) { error_ = error; }
32 bool is_closed() const { return closed_; }
34 FakeStreamChannelFactory& fake_channel_factory() { return channel_factory_; }
37 virtual void SetEventHandler(EventHandler* event_handler) OVERRIDE;
38 virtual ErrorCode error() OVERRIDE;
39 virtual const std::string& jid() OVERRIDE;
40 virtual const CandidateSessionConfig* candidate_config() OVERRIDE;
41 virtual const SessionConfig& config() OVERRIDE;
42 virtual void set_config(const SessionConfig& config) OVERRIDE;
43 virtual StreamChannelFactory* GetTransportChannelFactory() OVERRIDE;
44 virtual StreamChannelFactory* GetMultiplexedChannelFactory() OVERRIDE;
45 virtual void Close() OVERRIDE;
48 EventHandler* event_handler_;
49 scoped_ptr<const CandidateSessionConfig> candidate_config_;
50 SessionConfig config_;
52 FakeStreamChannelFactory channel_factory_;
59 DISALLOW_COPY_AND_ASSIGN(FakeSession);
62 } // namespace protocol
63 } // namespace remoting
65 #endif // REMOTING_PROTOCOL_FAKE_SESSION_H_