Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(32)

Side by Side Diff: content/renderer/media/webrtc/webrtc_media_stream_adapter_unittest.cc

Issue 2941563002: Enable new getUserMedia audio constraints algorithm behind a flag. (Closed)
Patch Set: remove vertical space from DEPS Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « content/renderer/media/webrtc/processed_local_audio_source_unittest.cc ('k') | extensions/browser/guest_view/web_view/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698