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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 blink::WebMediaStreamSource audio_source; | 54 blink::WebMediaStreamSource audio_source; |
55 audio_source.Initialize("audio", blink::WebMediaStreamSource::kTypeAudio, | 55 audio_source.Initialize("audio", blink::WebMediaStreamSource::kTypeAudio, |
56 "audio", false /* remote */); | 56 "audio", false /* remote */); |
57 ProcessedLocalAudioSource* const source = new ProcessedLocalAudioSource( | 57 ProcessedLocalAudioSource* const source = new ProcessedLocalAudioSource( |
58 -1 /* consumer_render_frame_id is N/A for non-browser tests */, | 58 -1 /* consumer_render_frame_id is N/A for non-browser tests */, |
59 StreamDeviceInfo(MEDIA_DEVICE_AUDIO_CAPTURE, "Mock audio device", | 59 StreamDeviceInfo(MEDIA_DEVICE_AUDIO_CAPTURE, "Mock audio device", |
60 "mock_audio_device_id", | 60 "mock_audio_device_id", |
61 media::AudioParameters::kAudioCDSampleRate, | 61 media::AudioParameters::kAudioCDSampleRate, |
62 media::CHANNEL_LAYOUT_STEREO, | 62 media::CHANNEL_LAYOUT_STEREO, |
63 media::AudioParameters::kAudioCDSampleRate / 50), | 63 media::AudioParameters::kAudioCDSampleRate / 50), |
64 MockConstraintFactory().CreateWebMediaConstraints(), | 64 AudioProcessingProperties(), |
65 base::Bind(&WebRtcMediaStreamAdapterTest::OnAudioSourceStarted), | 65 base::Bind(&WebRtcMediaStreamAdapterTest::OnAudioSourceStarted), |
66 dependency_factory_.get()); | 66 dependency_factory_.get()); |
67 source->SetAllowInvalidRenderFrameIdForTesting(true); | 67 source->SetAllowInvalidRenderFrameIdForTesting(true); |
68 audio_source.SetExtraData(source); // Takes ownership. | 68 audio_source.SetExtraData(source); // Takes ownership. |
69 audio_track_vector[0].Initialize(audio_source); | 69 audio_track_vector[0].Initialize(audio_source); |
70 EXPECT_CALL(*mock_audio_device_factory_.mock_capturer_source(), | 70 EXPECT_CALL(*mock_audio_device_factory_.mock_capturer_source(), |
71 Initialize(_, _, -1)); | 71 Initialize(_, _, -1)); |
72 EXPECT_CALL(*mock_audio_device_factory_.mock_capturer_source(), | 72 EXPECT_CALL(*mock_audio_device_factory_.mock_capturer_source(), |
73 SetAutomaticGainControl(true)); | 73 SetAutomaticGainControl(true)); |
74 EXPECT_CALL(*mock_audio_device_factory_.mock_capturer_source(), Start()); | 74 EXPECT_CALL(*mock_audio_device_factory_.mock_capturer_source(), Start()); |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 EXPECT_TRUE(webrtc_stream()->GetVideoTracks().empty()); | 175 EXPECT_TRUE(webrtc_stream()->GetVideoTracks().empty()); |
176 | 176 |
177 native_stream->AddTrack(audio_tracks[0]); | 177 native_stream->AddTrack(audio_tracks[0]); |
178 EXPECT_EQ(1u, webrtc_stream()->GetAudioTracks().size()); | 178 EXPECT_EQ(1u, webrtc_stream()->GetAudioTracks().size()); |
179 | 179 |
180 native_stream->AddTrack(video_tracks[0]); | 180 native_stream->AddTrack(video_tracks[0]); |
181 EXPECT_EQ(1u, webrtc_stream()->GetVideoTracks().size()); | 181 EXPECT_EQ(1u, webrtc_stream()->GetVideoTracks().size()); |
182 } | 182 } |
183 | 183 |
184 } // namespace content | 184 } // namespace content |
OLD | NEW |