Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(424)

Unified Diff: content/renderer/media/mock_peer_connection_impl.cc

Issue 9699069: Adding JSEP PeerConnection glue. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Deleting two renamed files. Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/renderer/media/mock_peer_connection_impl.cc
diff --git a/content/renderer/media/mock_peer_connection_impl.cc b/content/renderer/media/mock_peer_connection_impl.cc
index 8eeba32a9814c562f750ab49fa8111808b6c03db..1ef8c161dc77268e3173bdbdff95e79fb01db7eb 100644
--- a/content/renderer/media/mock_peer_connection_impl.cc
+++ b/content/renderer/media/mock_peer_connection_impl.cc
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "content/renderer/media/mock_media_stream_dependency_factory.h"
#include "content/renderer/media/mock_peer_connection_impl.h"
#include <vector>
@@ -36,9 +37,17 @@ class MockStreamCollection : public StreamCollectionInterface {
std::vector<MediaStreamInterface*> streams_;
};
-MockPeerConnectionImpl::MockPeerConnectionImpl()
- : stream_changes_committed_(false),
- remote_streams_(new talk_base::RefCountedObject<MockStreamCollection>) {
+MockPeerConnectionImpl::MockPeerConnectionImpl(
+ MockMediaStreamDependencyFactory* factory)
+ : kDummyOffer("dummy offer"),
+ dependency_factory_(factory),
+ stream_changes_committed_(false),
+ remote_streams_(new talk_base::RefCountedObject<MockStreamCollection>),
+ hint_audio_(false),
+ hint_video_(false),
+ action_(kAnswer),
+ ice_options_(kOnlyRelay),
+ ready_state_(kNew) {
}
MockPeerConnectionImpl::~MockPeerConnectionImpl() {}
@@ -82,8 +91,7 @@ void MockPeerConnectionImpl::Close() {
}
MockPeerConnectionImpl::ReadyState MockPeerConnectionImpl::ready_state() {
- NOTIMPLEMENTED();
- return kNew;
+ return ready_state_;
}
MockPeerConnectionImpl::SdpState MockPeerConnectionImpl::sdp_state() {
@@ -92,55 +100,56 @@ MockPeerConnectionImpl::SdpState MockPeerConnectionImpl::sdp_state() {
}
bool MockPeerConnectionImpl::StartIce(IceOptions options) {
- NOTIMPLEMENTED();
- return false;
+ ice_options_ = options;
+ return true;
}
webrtc::SessionDescriptionInterface* MockPeerConnectionImpl::CreateOffer(
const webrtc::MediaHints& hints) {
- NOTIMPLEMENTED();
- return NULL;
+ hint_audio_ = hints.has_audio();
+ hint_video_ = hints.has_video();
+ return dependency_factory_->CreateSessionDescription(kDummyOffer);
}
webrtc::SessionDescriptionInterface* MockPeerConnectionImpl::CreateAnswer(
const webrtc::MediaHints& hints,
const webrtc::SessionDescriptionInterface* offer) {
- NOTIMPLEMENTED();
- return NULL;
+ hint_audio_ = hints.has_audio();
+ hint_video_ = hints.has_video();
+ offer->ToString(&description_sdp_);
+ return dependency_factory_->CreateSessionDescription(description_sdp_);
}
bool MockPeerConnectionImpl::SetLocalDescription(
Action action,
webrtc::SessionDescriptionInterface* desc) {
- NOTIMPLEMENTED();
- return false;
+ action_ = action;
+ return desc->ToString(&description_sdp_);
}
bool MockPeerConnectionImpl::SetRemoteDescription(
Action action,
webrtc::SessionDescriptionInterface* desc) {
- NOTIMPLEMENTED();
- return false;
+ action_ = action;
+ return desc->ToString(&description_sdp_);
}
bool MockPeerConnectionImpl::ProcessIceMessage(
const webrtc::IceCandidateInterface* ice_candidate) {
- NOTIMPLEMENTED();
- return false;
+ ice_label_ = ice_candidate->label();
+ return ice_candidate->ToString(&ice_sdp_);
}
const webrtc::SessionDescriptionInterface*
MockPeerConnectionImpl::local_description()
const {
- NOTIMPLEMENTED();
- return NULL;
+ return dependency_factory_->CreateSessionDescription(description_sdp_);
}
const webrtc::SessionDescriptionInterface*
MockPeerConnectionImpl::remote_description()
const {
- NOTIMPLEMENTED();
- return NULL;
+ return dependency_factory_->CreateSessionDescription(description_sdp_);
}
void MockPeerConnectionImpl::AddRemoteStream(MediaStreamInterface* stream) {

Powered by Google App Engine
This is Rietveld 408576698