| 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/rtc_peer_connection_handler.h" | 5 #include "content/renderer/media/rtc_peer_connection_handler.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 | 245 |
| 246 // Creates a WebKit local MediaStream. | 246 // Creates a WebKit local MediaStream. |
| 247 blink::WebMediaStream CreateLocalMediaStream( | 247 blink::WebMediaStream CreateLocalMediaStream( |
| 248 const std::string& stream_label) { | 248 const std::string& stream_label) { |
| 249 std::string video_track_label("video-label"); | 249 std::string video_track_label("video-label"); |
| 250 std::string audio_track_label("audio-label"); | 250 std::string audio_track_label("audio-label"); |
| 251 blink::WebMediaStreamSource audio_source; | 251 blink::WebMediaStreamSource audio_source; |
| 252 audio_source.initialize(blink::WebString::fromUTF8(audio_track_label), | 252 audio_source.initialize(blink::WebString::fromUTF8(audio_track_label), |
| 253 blink::WebMediaStreamSource::TypeAudio, | 253 blink::WebMediaStreamSource::TypeAudio, |
| 254 blink::WebString::fromUTF8("audio_track"), | 254 blink::WebString::fromUTF8("audio_track"), |
| 255 false /* remote */, true /* readonly */); | 255 false /* remote */); |
| 256 audio_source.setExtraData(new MediaStreamAudioSource()); | 256 audio_source.setExtraData(new MediaStreamAudioSource()); |
| 257 blink::WebMediaStreamSource video_source; | 257 blink::WebMediaStreamSource video_source; |
| 258 video_source.initialize(blink::WebString::fromUTF8(video_track_label), | 258 video_source.initialize(blink::WebString::fromUTF8(video_track_label), |
| 259 blink::WebMediaStreamSource::TypeVideo, | 259 blink::WebMediaStreamSource::TypeVideo, |
| 260 blink::WebString::fromUTF8("video_track"), | 260 blink::WebString::fromUTF8("video_track"), |
| 261 false /* remote */, true /* readonly */); | 261 false /* remote */); |
| 262 MockMediaStreamVideoSource* native_video_source = | 262 MockMediaStreamVideoSource* native_video_source = |
| 263 new MockMediaStreamVideoSource(false); | 263 new MockMediaStreamVideoSource(false); |
| 264 video_source.setExtraData(native_video_source); | 264 video_source.setExtraData(native_video_source); |
| 265 | 265 |
| 266 blink::WebVector<blink::WebMediaStreamTrack> audio_tracks( | 266 blink::WebVector<blink::WebMediaStreamTrack> audio_tracks( |
| 267 static_cast<size_t>(1)); | 267 static_cast<size_t>(1)); |
| 268 audio_tracks[0].initialize(audio_source.id(), audio_source); | 268 audio_tracks[0].initialize(audio_source.id(), audio_source); |
| 269 scoped_refptr<WebRtcLocalAudioTrackAdapter> adapter( | 269 scoped_refptr<WebRtcLocalAudioTrackAdapter> adapter( |
| 270 WebRtcLocalAudioTrackAdapter::Create(audio_track_label, nullptr)); | 270 WebRtcLocalAudioTrackAdapter::Create(audio_track_label, nullptr)); |
| 271 std::unique_ptr<WebRtcLocalAudioTrack> native_track( | 271 std::unique_ptr<WebRtcLocalAudioTrack> native_track( |
| (...skipping 749 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1021 EXPECT_CALL(*mock_tracker_.get(), | 1021 EXPECT_CALL(*mock_tracker_.get(), |
| 1022 TrackCreateDTMFSender(pc_handler_.get(), | 1022 TrackCreateDTMFSender(pc_handler_.get(), |
| 1023 testing::Ref(tracks[0]))); | 1023 testing::Ref(tracks[0]))); |
| 1024 | 1024 |
| 1025 std::unique_ptr<blink::WebRTCDTMFSenderHandler> sender( | 1025 std::unique_ptr<blink::WebRTCDTMFSenderHandler> sender( |
| 1026 pc_handler_->createDTMFSender(tracks[0])); | 1026 pc_handler_->createDTMFSender(tracks[0])); |
| 1027 EXPECT_TRUE(sender.get()); | 1027 EXPECT_TRUE(sender.get()); |
| 1028 } | 1028 } |
| 1029 | 1029 |
| 1030 } // namespace content | 1030 } // namespace content |
| OLD | NEW |