| 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 <string> | 5 #include <string> |
| 6 #include <vector> | 6 #include <vector> |
| 7 | 7 |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "base/values.h" | 10 #include "base/values.h" |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 WebKit::WebMediaStream local_stream; | 243 WebKit::WebMediaStream local_stream; |
| 244 local_stream.initialize(UTF8ToUTF16(stream_label), audio_tracks, | 244 local_stream.initialize(UTF8ToUTF16(stream_label), audio_tracks, |
| 245 video_tracks); | 245 video_tracks); |
| 246 | 246 |
| 247 scoped_refptr<webrtc::MediaStreamInterface> native_stream( | 247 scoped_refptr<webrtc::MediaStreamInterface> native_stream( |
| 248 mock_dependency_factory_->CreateLocalMediaStream(stream_label)); | 248 mock_dependency_factory_->CreateLocalMediaStream(stream_label)); |
| 249 | 249 |
| 250 local_stream.audioTracks(audio_tracks); | 250 local_stream.audioTracks(audio_tracks); |
| 251 const std::string audio_track_id = UTF16ToUTF8(audio_tracks[0].id()); | 251 const std::string audio_track_id = UTF16ToUTF8(audio_tracks[0].id()); |
| 252 scoped_refptr<WebRtcAudioCapturer> capturer; | 252 scoped_refptr<WebRtcAudioCapturer> capturer; |
| 253 RTCMediaConstraints audio_constraints(audio_source.constraints()); |
| 253 scoped_refptr<webrtc::AudioTrackInterface> audio_track( | 254 scoped_refptr<webrtc::AudioTrackInterface> audio_track( |
| 254 mock_dependency_factory_->CreateLocalAudioTrack(audio_track_id, | 255 mock_dependency_factory_->CreateLocalAudioTrack( |
| 255 capturer, | 256 audio_track_id, capturer, NULL, |
| 256 NULL)); | 257 &audio_constraints)); |
| 257 native_stream->AddTrack(audio_track.get()); | 258 native_stream->AddTrack(audio_track.get()); |
| 258 | 259 |
| 259 local_stream.videoTracks(video_tracks); | 260 local_stream.videoTracks(video_tracks); |
| 260 const std::string video_track_id = UTF16ToUTF8(video_tracks[0].id()); | 261 const std::string video_track_id = UTF16ToUTF8(video_tracks[0].id()); |
| 261 webrtc::VideoSourceInterface* source = NULL; | 262 webrtc::VideoSourceInterface* source = NULL; |
| 262 scoped_refptr<webrtc::VideoTrackInterface> video_track( | 263 scoped_refptr<webrtc::VideoTrackInterface> video_track( |
| 263 mock_dependency_factory_->CreateLocalVideoTrack( | 264 mock_dependency_factory_->CreateLocalVideoTrack( |
| 264 video_track_id, source)); | 265 video_track_id, source)); |
| 265 native_stream->AddTrack(video_track.get()); | 266 native_stream->AddTrack(video_track.get()); |
| 266 | 267 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 282 scoped_refptr<webrtc::VideoTrackInterface> video_track( | 283 scoped_refptr<webrtc::VideoTrackInterface> video_track( |
| 283 mock_dependency_factory_->CreateLocalVideoTrack( | 284 mock_dependency_factory_->CreateLocalVideoTrack( |
| 284 video_track_label, source)); | 285 video_track_label, source)); |
| 285 stream->AddTrack(video_track.get()); | 286 stream->AddTrack(video_track.get()); |
| 286 } | 287 } |
| 287 if (!audio_track_label.empty()) { | 288 if (!audio_track_label.empty()) { |
| 288 scoped_refptr<WebRtcAudioCapturer> capturer; | 289 scoped_refptr<WebRtcAudioCapturer> capturer; |
| 289 scoped_refptr<webrtc::AudioTrackInterface> audio_track( | 290 scoped_refptr<webrtc::AudioTrackInterface> audio_track( |
| 290 mock_dependency_factory_->CreateLocalAudioTrack(audio_track_label, | 291 mock_dependency_factory_->CreateLocalAudioTrack(audio_track_label, |
| 291 capturer, | 292 capturer, |
| 293 NULL, |
| 292 NULL)); | 294 NULL)); |
| 293 stream->AddTrack(audio_track.get()); | 295 stream->AddTrack(audio_track.get()); |
| 294 } | 296 } |
| 295 mock_peer_connection_->AddRemoteStream(stream.get()); | 297 mock_peer_connection_->AddRemoteStream(stream.get()); |
| 296 return stream; | 298 return stream; |
| 297 } | 299 } |
| 298 | 300 |
| 299 scoped_ptr<MockWebRTCPeerConnectionHandlerClient> mock_client_; | 301 scoped_ptr<MockWebRTCPeerConnectionHandlerClient> mock_client_; |
| 300 scoped_ptr<MockMediaStreamDependencyFactory> mock_dependency_factory_; | 302 scoped_ptr<MockMediaStreamDependencyFactory> mock_dependency_factory_; |
| 301 scoped_ptr<NiceMock<MockPeerConnectionTracker> > mock_tracker_; | 303 scoped_ptr<NiceMock<MockPeerConnectionTracker> > mock_tracker_; |
| (...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 819 EXPECT_CALL(*mock_tracker_.get(), | 821 EXPECT_CALL(*mock_tracker_.get(), |
| 820 TrackCreateDTMFSender(pc_handler_.get(), | 822 TrackCreateDTMFSender(pc_handler_.get(), |
| 821 testing::Ref(tracks[0]))); | 823 testing::Ref(tracks[0]))); |
| 822 | 824 |
| 823 scoped_ptr<WebKit::WebRTCDTMFSenderHandler> sender( | 825 scoped_ptr<WebKit::WebRTCDTMFSenderHandler> sender( |
| 824 pc_handler_->createDTMFSender(tracks[0])); | 826 pc_handler_->createDTMFSender(tracks[0])); |
| 825 EXPECT_TRUE(sender.get()); | 827 EXPECT_TRUE(sender.get()); |
| 826 } | 828 } |
| 827 | 829 |
| 828 } // namespace content | 830 } // namespace content |
| OLD | NEW |