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 "base/logging.h" |
| 6 #include "content/renderer/media/mock_media_stream_dependency_factory.h" |
| 7 #include "content/renderer/media/mock_peer_connection_impl.h" |
| 8 #include "third_party/libjingle/source/talk/session/phone/webrtcmediaengine.h" |
| 9 |
| 10 MockMediaStreamDependencyFactory::MockMediaStreamDependencyFactory() |
| 11 : mock_pc_factory_created_(false) { |
| 12 } |
| 13 |
| 14 MockMediaStreamDependencyFactory::~MockMediaStreamDependencyFactory() {} |
| 15 |
| 16 cricket::WebRtcMediaEngine* |
| 17 MockMediaStreamDependencyFactory::CreateWebRtcMediaEngine() { |
| 18 return new cricket::WebRtcMediaEngine(NULL, NULL, NULL); |
| 19 } |
| 20 |
| 21 bool MockMediaStreamDependencyFactory::CreatePeerConnectionFactory( |
| 22 cricket::PortAllocator* port_allocator, |
| 23 cricket::MediaEngineInterface* media_engine, |
| 24 talk_base::Thread* worker_thread) { |
| 25 mock_pc_factory_created_ = true; |
| 26 return true; |
| 27 } |
| 28 |
| 29 void MockMediaStreamDependencyFactory::DeletePeerConnectionFactory() { |
| 30 mock_pc_factory_created_ = false; |
| 31 } |
| 32 |
| 33 bool MockMediaStreamDependencyFactory::PeerConnectionFactoryCreated() { |
| 34 return mock_pc_factory_created_; |
| 35 } |
| 36 |
| 37 webrtc::PeerConnection* MockMediaStreamDependencyFactory::CreatePeerConnection( |
| 38 talk_base::Thread* signaling_thread) { |
| 39 DCHECK(mock_pc_factory_created_); |
| 40 return new webrtc::MockPeerConnectionImpl(); |
| 41 } |
OLD | NEW |