DCHECK that ProfileSyncService is created on the UI thread.
[chromium-blink-merge.git] / remoting / protocol / fake_session.cc
blobba6a5a97992edeb7400b7d39a3d3832fdd59e366
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 #include "remoting/protocol/fake_session.h"
7 namespace remoting {
8 namespace protocol {
10 const char kTestJid[] = "host1@gmail.com/chromoting123";
12 FakeSession::FakeSession()
13 : event_handler_(nullptr),
14 candidate_config_(CandidateSessionConfig::CreateDefault()),
15 config_(SessionConfig::ForTest()),
16 jid_(kTestJid),
17 error_(OK),
18 closed_(false) {
20 FakeSession::~FakeSession() { }
22 void FakeSession::SetEventHandler(EventHandler* event_handler) {
23 event_handler_ = event_handler;
26 ErrorCode FakeSession::error() {
27 return error_;
30 const std::string& FakeSession::jid() {
31 return jid_;
34 const CandidateSessionConfig* FakeSession::candidate_config() {
35 return candidate_config_.get();
38 const SessionConfig& FakeSession::config() {
39 return config_;
42 void FakeSession::set_config(const SessionConfig& config) {
43 config_ = config;
46 StreamChannelFactory* FakeSession::GetTransportChannelFactory() {
47 return &channel_factory_;
50 StreamChannelFactory* FakeSession::GetMultiplexedChannelFactory() {
51 return &channel_factory_;
54 void FakeSession::Close() {
55 closed_ = true;
58 } // namespace protocol
59 } // namespace remoting