| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/renderer/media/mock_media_stream_dependency_factory.h" | 5 #include "content/renderer/media/mock_media_stream_dependency_factory.h" |
| 6 #include "content/renderer/media/mock_peer_connection_impl.h" | 6 #include "content/renderer/media/mock_peer_connection_impl.h" |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 DCHECK(stream_label_.empty()); | 77 DCHECK(stream_label_.empty()); |
| 78 stream_label_ = stream->label(); | 78 stream_label_ = stream->label(); |
| 79 local_streams_->AddStream(stream); | 79 local_streams_->AddStream(stream); |
| 80 } | 80 } |
| 81 | 81 |
| 82 void MockPeerConnectionImpl::RemoveStream(LocalMediaStreamInterface* stream) { | 82 void MockPeerConnectionImpl::RemoveStream(LocalMediaStreamInterface* stream) { |
| 83 DCHECK_EQ(stream_label_, stream->label()); | 83 DCHECK_EQ(stream_label_, stream->label()); |
| 84 stream_label_.clear(); | 84 stream_label_.clear(); |
| 85 } | 85 } |
| 86 | 86 |
| 87 bool MockPeerConnectionImpl::RemoveStream(const std::string& label) { |
| 88 if (stream_label_ != label) |
| 89 return false; |
| 90 stream_label_.clear(); |
| 91 return true; |
| 92 } |
| 93 |
| 87 void MockPeerConnectionImpl::CommitStreamChanges() { | 94 void MockPeerConnectionImpl::CommitStreamChanges() { |
| 88 stream_changes_committed_ = true; | 95 stream_changes_committed_ = true; |
| 89 } | 96 } |
| 90 | 97 |
| 91 void MockPeerConnectionImpl::Close() { | 98 void MockPeerConnectionImpl::Close() { |
| 92 signaling_message_.clear(); | 99 signaling_message_.clear(); |
| 93 stream_label_.clear(); | 100 stream_label_.clear(); |
| 94 stream_changes_committed_ = false; | 101 stream_changes_committed_ = false; |
| 95 } | 102 } |
| 96 | 103 |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 const webrtc::SessionDescriptionInterface* | 161 const webrtc::SessionDescriptionInterface* |
| 155 MockPeerConnectionImpl::remote_description() const { | 162 MockPeerConnectionImpl::remote_description() const { |
| 156 return remote_desc_.get(); | 163 return remote_desc_.get(); |
| 157 } | 164 } |
| 158 | 165 |
| 159 void MockPeerConnectionImpl::AddRemoteStream(MediaStreamInterface* stream) { | 166 void MockPeerConnectionImpl::AddRemoteStream(MediaStreamInterface* stream) { |
| 160 remote_streams_->AddStream(stream); | 167 remote_streams_->AddStream(stream); |
| 161 } | 168 } |
| 162 | 169 |
| 163 } // namespace webrtc | 170 } // namespace webrtc |
| OLD | NEW |