| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/webrtc/webrtc_media_stream_adapter.h" | 5 #include "content/renderer/media/webrtc/webrtc_media_stream_adapter.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 audio ? static_cast<size_t>(1) : 0); | 47 audio ? static_cast<size_t>(1) : 0); |
| 48 if (audio) { | 48 if (audio) { |
| 49 blink::WebMediaStreamSource audio_source; | 49 blink::WebMediaStreamSource audio_source; |
| 50 audio_source.initialize("audio", | 50 audio_source.initialize("audio", |
| 51 blink::WebMediaStreamSource::TypeAudio, | 51 blink::WebMediaStreamSource::TypeAudio, |
| 52 "audio", | 52 "audio", |
| 53 false /* remote */); | 53 false /* remote */); |
| 54 ProcessedLocalAudioSource* const source = new ProcessedLocalAudioSource( | 54 ProcessedLocalAudioSource* const source = new ProcessedLocalAudioSource( |
| 55 -1 /* consumer_render_frame_id is N/A for non-browser tests */, | 55 -1 /* consumer_render_frame_id is N/A for non-browser tests */, |
| 56 StreamDeviceInfo(MEDIA_DEVICE_AUDIO_CAPTURE, "Mock audio device", | 56 StreamDeviceInfo(MEDIA_DEVICE_AUDIO_CAPTURE, "Mock audio device", |
| 57 "mock_audio_device_id", "mock_group_id", | 57 "mock_audio_device_id", |
| 58 media::AudioParameters::kAudioCDSampleRate, | 58 media::AudioParameters::kAudioCDSampleRate, |
| 59 media::CHANNEL_LAYOUT_STEREO, | 59 media::CHANNEL_LAYOUT_STEREO, |
| 60 media::AudioParameters::kAudioCDSampleRate / 50), | 60 media::AudioParameters::kAudioCDSampleRate / 50), |
| 61 dependency_factory_.get()); | 61 dependency_factory_.get()); |
| 62 source->SetAllowInvalidRenderFrameIdForTesting(true); | 62 source->SetAllowInvalidRenderFrameIdForTesting(true); |
| 63 source->SetSourceConstraints( | 63 source->SetSourceConstraints( |
| 64 MockConstraintFactory().CreateWebMediaConstraints()); | 64 MockConstraintFactory().CreateWebMediaConstraints()); |
| 65 audio_source.setExtraData(source); // Takes ownership. | 65 audio_source.setExtraData(source); // Takes ownership. |
| 66 audio_track_vector[0].initialize(audio_source); | 66 audio_track_vector[0].initialize(audio_source); |
| 67 EXPECT_CALL(*mock_audio_device_factory_.mock_capturer_source(), | 67 EXPECT_CALL(*mock_audio_device_factory_.mock_capturer_source(), |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 EXPECT_TRUE(webrtc_stream()->GetVideoTracks().empty()); | 174 EXPECT_TRUE(webrtc_stream()->GetVideoTracks().empty()); |
| 175 | 175 |
| 176 native_stream->AddTrack(audio_tracks[0]); | 176 native_stream->AddTrack(audio_tracks[0]); |
| 177 EXPECT_EQ(1u, webrtc_stream()->GetAudioTracks().size()); | 177 EXPECT_EQ(1u, webrtc_stream()->GetAudioTracks().size()); |
| 178 | 178 |
| 179 native_stream->AddTrack(video_tracks[0]); | 179 native_stream->AddTrack(video_tracks[0]); |
| 180 EXPECT_EQ(1u, webrtc_stream()->GetVideoTracks().size()); | 180 EXPECT_EQ(1u, webrtc_stream()->GetVideoTracks().size()); |
| 181 } | 181 } |
| 182 | 182 |
| 183 } // namespace content | 183 } // namespace content |
| OLD | NEW |