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. 4 5#include "remoting/protocol/fake_session.h" 6 7namespace remoting { 8namespace protocol { 9 10const char kTestJid[] = "host1@gmail.com/chromoting123"; 11 12FakeSession::FakeSession() 13 : event_handler_(NULL), 14 candidate_config_(CandidateSessionConfig::CreateDefault()), 15 config_(SessionConfig::ForTest()), 16 jid_(kTestJid), 17 error_(OK), 18 closed_(false) { 19} 20FakeSession::~FakeSession() { } 21 22void FakeSession::SetEventHandler(EventHandler* event_handler) { 23 event_handler_ = event_handler; 24} 25 26ErrorCode FakeSession::error() { 27 return error_; 28} 29 30const std::string& FakeSession::jid() { 31 return jid_; 32} 33 34const CandidateSessionConfig* FakeSession::candidate_config() { 35 return candidate_config_.get(); 36} 37 38const SessionConfig& FakeSession::config() { 39 return config_; 40} 41 42void FakeSession::set_config(const SessionConfig& config) { 43 config_ = config; 44} 45 46StreamChannelFactory* FakeSession::GetTransportChannelFactory() { 47 return &channel_factory_; 48} 49 50StreamChannelFactory* FakeSession::GetMultiplexedChannelFactory() { 51 return &channel_factory_; 52} 53 54void FakeSession::Close() { 55 closed_ = true; 56} 57 58} // namespace protocol 59} // namespace remoting 60