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 "base/logging.h" | 5 #include "base/logging.h" |
6 #include "content/renderer/media/mock_media_stream_dependency_factory.h" | 6 #include "content/renderer/media/mock_media_stream_dependency_factory.h" |
7 #include "content/renderer/media/mock_peer_connection_impl.h" | 7 #include "content/renderer/media/mock_peer_connection_impl.h" |
8 #include "third_party/libjingle/source/talk/app/webrtc/mediastreaminterface.h" | 8 #include "third_party/libjingle/source/talk/app/webrtc/mediastreaminterface.h" |
9 #include "third_party/libjingle/source/talk/base/scoped_ref_ptr.h" | 9 #include "third_party/libjingle/source/talk/base/scoped_ref_ptr.h" |
10 | 10 |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 return NULL; | 183 return NULL; |
184 } | 184 } |
185 virtual std::string session_id() const OVERRIDE { | 185 virtual std::string session_id() const OVERRIDE { |
186 NOTIMPLEMENTED(); | 186 NOTIMPLEMENTED(); |
187 return ""; | 187 return ""; |
188 } | 188 } |
189 virtual std::string session_version() const OVERRIDE { | 189 virtual std::string session_version() const OVERRIDE { |
190 NOTIMPLEMENTED(); | 190 NOTIMPLEMENTED(); |
191 return ""; | 191 return ""; |
192 } | 192 } |
193 virtual SdpType type() const OVERRIDE { | 193 virtual std::string type() const OVERRIDE { |
194 NOTIMPLEMENTED(); | 194 NOTIMPLEMENTED(); |
195 return kOffer; | 195 return ""; |
196 } | 196 } |
197 virtual bool AddCandidate(const IceCandidateInterface* candidate) OVERRIDE { | 197 virtual bool AddCandidate(const IceCandidateInterface* candidate) OVERRIDE { |
198 NOTIMPLEMENTED(); | 198 NOTIMPLEMENTED(); |
199 return false; | 199 return false; |
200 } | 200 } |
201 virtual size_t number_of_mediasections() const OVERRIDE { | 201 virtual size_t number_of_mediasections() const OVERRIDE { |
202 NOTIMPLEMENTED(); | 202 NOTIMPLEMENTED(); |
203 return 0; | 203 return 0; |
204 } | 204 } |
205 virtual const IceCandidateCollection* candidates( | 205 virtual const IceCandidateCollection* candidates( |
206 size_t mediasection_index) const OVERRIDE { | 206 size_t mediasection_index) const OVERRIDE { |
207 NOTIMPLEMENTED(); | 207 NOTIMPLEMENTED(); |
208 return NULL; | 208 return NULL; |
209 } | 209 } |
210 | 210 |
211 virtual bool ToString(std::string* out) const OVERRIDE { | 211 virtual bool ToString(std::string* out) const OVERRIDE { |
212 *out = sdp_; | 212 *out = sdp_; |
213 return true; | 213 return true; |
214 } | 214 } |
215 | 215 |
216 private: | 216 private: |
217 std::string sdp_; | 217 std::string sdp_; |
218 }; | 218 }; |
219 | 219 |
220 class MockIceCandidate : public IceCandidateInterface { | 220 class MockIceCandidate : public IceCandidateInterface { |
221 public: | 221 public: |
222 MockIceCandidate(const std::string& label, const std::string& sdp) | 222 MockIceCandidate(const std::string& sdp_mid, |
223 : label_(label), | 223 int sdp_mline_index, |
| 224 const std::string& sdp) |
| 225 : sdp_mid_(sdp_mid), |
| 226 sdp_mline_index_(sdp_mline_index), |
224 sdp_(sdp) { | 227 sdp_(sdp) { |
225 } | 228 } |
226 virtual ~MockIceCandidate() {} | 229 virtual ~MockIceCandidate() {} |
227 virtual std::string label() const OVERRIDE { | 230 virtual std::string sdp_mid() const OVERRIDE { |
228 return label_; | 231 return sdp_mid_; |
| 232 } |
| 233 virtual int sdp_mline_index() const OVERRIDE { |
| 234 return sdp_mline_index_; |
229 } | 235 } |
230 virtual const cricket::Candidate& candidate() const OVERRIDE { | 236 virtual const cricket::Candidate& candidate() const OVERRIDE { |
231 // This function should never be called. It will intentionally crash. The | 237 // This function should never be called. It will intentionally crash. The |
232 // base class forces us to return a reference. | 238 // base class forces us to return a reference. |
233 NOTREACHED(); | 239 NOTREACHED(); |
234 cricket::Candidate* candidate = NULL; | 240 cricket::Candidate* candidate = NULL; |
235 return *candidate; | 241 return *candidate; |
236 } | 242 } |
237 virtual bool ToString(std::string* out) const OVERRIDE { | 243 virtual bool ToString(std::string* out) const OVERRIDE { |
238 *out = sdp_; | 244 *out = sdp_; |
239 return true; | 245 return true; |
240 } | 246 } |
241 | 247 |
242 private: | 248 private: |
243 std::string label_; | 249 std::string sdp_mid_; |
| 250 int sdp_mline_index_; |
244 std::string sdp_; | 251 std::string sdp_; |
245 }; | 252 }; |
246 | 253 |
247 } // namespace webrtc | 254 } // namespace webrtc |
248 | 255 |
249 MockMediaStreamDependencyFactory::MockMediaStreamDependencyFactory( | 256 MockMediaStreamDependencyFactory::MockMediaStreamDependencyFactory( |
250 VideoCaptureImplManager* vc_manager) | 257 VideoCaptureImplManager* vc_manager) |
251 : MediaStreamDependencyFactory(vc_manager), | 258 : MediaStreamDependencyFactory(vc_manager), |
252 mock_pc_factory_created_(false) { | 259 mock_pc_factory_created_(false) { |
253 } | 260 } |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
307 } | 314 } |
308 | 315 |
309 webrtc::SessionDescriptionInterface* | 316 webrtc::SessionDescriptionInterface* |
310 MockMediaStreamDependencyFactory::CreateSessionDescription( | 317 MockMediaStreamDependencyFactory::CreateSessionDescription( |
311 const std::string& sdp) { | 318 const std::string& sdp) { |
312 return new webrtc::MockSessionDescription(sdp); | 319 return new webrtc::MockSessionDescription(sdp); |
313 } | 320 } |
314 | 321 |
315 webrtc::IceCandidateInterface* | 322 webrtc::IceCandidateInterface* |
316 MockMediaStreamDependencyFactory::CreateIceCandidate( | 323 MockMediaStreamDependencyFactory::CreateIceCandidate( |
317 const std::string& label, | 324 const std::string& media_id, |
| 325 int m_line_index, |
318 const std::string& sdp) { | 326 const std::string& sdp) { |
319 return new webrtc::MockIceCandidate(label, sdp); | 327 return new webrtc::MockIceCandidate(media_id, m_line_index, sdp); |
320 } | 328 } |
OLD | NEW |