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

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

Issue 10703095: New PeerConnection handler in Chrome to support latest PeerConnection draft (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added unit test and mock. Removed old bad mock. Created 8 years, 4 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_media_stream_dependency_factory.cc
diff --git a/content/renderer/media/mock_media_stream_dependency_factory.cc b/content/renderer/media/mock_media_stream_dependency_factory.cc
index c58ce86abfeb060d9ec10750667f70a2c3b980ed..28254cca13596c9e5dc773602c53c0964784fa52 100644
--- a/content/renderer/media/mock_media_stream_dependency_factory.cc
+++ b/content/renderer/media/mock_media_stream_dependency_factory.cc
@@ -166,8 +166,10 @@ void MockLocalAudioTrack::UnregisterObserver(ObserverInterface* observer) {
class MockSessionDescription : public SessionDescriptionInterface {
public:
- MockSessionDescription(const std::string& sdp)
- : sdp_(sdp) {
+ MockSessionDescription(const std::string& type,
+ const std::string& sdp)
+ : type_(type),
+ sdp_(sdp) {
}
virtual ~MockSessionDescription() {}
virtual const cricket::SessionDescription* description() const OVERRIDE {
@@ -183,8 +185,7 @@ class MockSessionDescription : public SessionDescriptionInterface {
return "";
}
virtual std::string type() const OVERRIDE {
- NOTIMPLEMENTED();
- return "";
+ return type_;
}
virtual bool AddCandidate(const IceCandidateInterface* candidate) OVERRIDE {
NOTIMPLEMENTED();
@@ -206,6 +207,7 @@ class MockSessionDescription : public SessionDescriptionInterface {
}
private:
+ std::string type_;
std::string sdp_;
};
@@ -279,6 +281,15 @@ MockMediaStreamDependencyFactory::CreatePeerConnection(
return new talk_base::RefCountedObject<webrtc::MockPeerConnectionImpl>(this);
}
+talk_base::scoped_refptr<webrtc::PeerConnectionInterface>
+MockMediaStreamDependencyFactory::CreatePeerConnection(
+ const webrtc::JsepInterface::IceServers& ice_servers,
+ const webrtc::MediaConstraintsInterface* constraints,
+ webrtc::PeerConnectionObserver* observer) {
+ DCHECK(mock_pc_factory_created_);
+ return new talk_base::RefCountedObject<webrtc::MockPeerConnectionImpl>(this);
+}
+
talk_base::scoped_refptr<webrtc::LocalMediaStreamInterface>
MockMediaStreamDependencyFactory::CreateLocalMediaStream(
const std::string& label) {
@@ -308,7 +319,14 @@ MockMediaStreamDependencyFactory::CreateLocalAudioTrack(
webrtc::SessionDescriptionInterface*
MockMediaStreamDependencyFactory::CreateSessionDescription(
const std::string& sdp) {
- return new webrtc::MockSessionDescription(sdp);
+ return CreateSessionDescription ("unknown", sdp);
+}
+
+webrtc::SessionDescriptionInterface*
+MockMediaStreamDependencyFactory::CreateSessionDescription(
+ const std::string& type,
+ const std::string& sdp) {
+ return new webrtc::MockSessionDescription(type, sdp);
}
webrtc::IceCandidateInterface*

Powered by Google App Engine
This is Rietveld 408576698