OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2011 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 "content/renderer/media/mock_peer_connection_impl.h" |
| 6 |
| 7 #include "base/logging.h" |
| 8 |
| 9 namespace webrtc { |
| 10 |
| 11 MockPeerConnectionImpl::MockPeerConnectionImpl() |
| 12 : observer_(NULL), |
| 13 video_stream_(false), |
| 14 connected_(false), |
| 15 video_capture_set_(false) { |
| 16 } |
| 17 |
| 18 MockPeerConnectionImpl::~MockPeerConnectionImpl() {} |
| 19 |
| 20 void MockPeerConnectionImpl::RegisterObserver( |
| 21 PeerConnectionObserver* observer) { |
| 22 observer_ = observer; |
| 23 } |
| 24 |
| 25 bool MockPeerConnectionImpl::SignalingMessage( |
| 26 const std::string& signaling_message) { |
| 27 signaling_message_ = signaling_message; |
| 28 return true; |
| 29 } |
| 30 |
| 31 bool MockPeerConnectionImpl::AddStream( |
| 32 const std::string& stream_id, |
| 33 bool video) { |
| 34 stream_id_ = stream_id; |
| 35 video_stream_ = video; |
| 36 return true; |
| 37 } |
| 38 |
| 39 bool MockPeerConnectionImpl::RemoveStream(const std::string& stream_id) { |
| 40 stream_id_.clear(); |
| 41 video_stream_ = false; |
| 42 return true; |
| 43 } |
| 44 |
| 45 bool MockPeerConnectionImpl::Connect() { |
| 46 connected_ = true; |
| 47 return true; |
| 48 } |
| 49 |
| 50 bool MockPeerConnectionImpl::Close() { |
| 51 observer_ = NULL; |
| 52 signaling_message_.clear(); |
| 53 stream_id_.clear(); |
| 54 video_stream_ = false; |
| 55 connected_ = false; |
| 56 video_capture_set_ = false; |
| 57 return true; |
| 58 } |
| 59 |
| 60 bool MockPeerConnectionImpl::SetAudioDevice( |
| 61 const std::string& wave_in_device, |
| 62 const std::string& wave_out_device, |
| 63 int opts) { |
| 64 NOTIMPLEMENTED(); |
| 65 return false; |
| 66 } |
| 67 |
| 68 bool MockPeerConnectionImpl::SetLocalVideoRenderer( |
| 69 cricket::VideoRenderer* renderer) { |
| 70 NOTIMPLEMENTED(); |
| 71 return false; |
| 72 } |
| 73 |
| 74 bool MockPeerConnectionImpl::SetVideoRenderer( |
| 75 const std::string& stream_id, |
| 76 cricket::VideoRenderer* renderer) { |
| 77 NOTIMPLEMENTED(); |
| 78 return false; |
| 79 } |
| 80 |
| 81 bool MockPeerConnectionImpl::SetVideoCapture(const std::string& cam_device) { |
| 82 video_capture_set_ = true; |
| 83 return true; |
| 84 } |
| 85 |
| 86 MockPeerConnectionImpl::ReadyState MockPeerConnectionImpl::GetReadyState() { |
| 87 NOTIMPLEMENTED(); |
| 88 return NEW; |
| 89 } |
| 90 |
| 91 } // namespace webrtc |
OLD | NEW |