| OLD | NEW |
| (Empty) |
| 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 "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::MediaEngineInterface* media_engine, | |
| 23 talk_base::Thread* worker_thread) { | |
| 24 mock_pc_factory_created_ = true; | |
| 25 media_engine_.reset(media_engine); | |
| 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 cricket::PortAllocator* MockMediaStreamDependencyFactory::CreatePortAllocator( | |
| 38 content::P2PSocketDispatcher* socket_dispatcher, | |
| 39 talk_base::NetworkManager* network_manager, | |
| 40 talk_base::PacketSocketFactory* socket_factory, | |
| 41 const webkit_glue::P2PTransport::Config& config) { | |
| 42 return NULL; | |
| 43 } | |
| 44 | |
| 45 webrtc::PeerConnection* MockMediaStreamDependencyFactory::CreatePeerConnection( | |
| 46 cricket::PortAllocator* port_allocator, | |
| 47 talk_base::Thread* signaling_thread) { | |
| 48 DCHECK(mock_pc_factory_created_); | |
| 49 return new webrtc::MockPeerConnectionImpl(); | |
| 50 } | |
| OLD | NEW |