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

Side by Side Diff: content/renderer/media/webrtc_audio_capturer_unittest.cc

Issue 883293005: Cast: Basic cast_receiver API for chrome. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: removed extra BUILD.gn line Created 5 years, 10 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "base/logging.h" 5 #include "base/logging.h"
6 #include "content/public/renderer/media_stream_audio_sink.h" 6 #include "content/public/renderer/media_stream_audio_sink.h"
7 #include "content/renderer/media/mock_media_constraint_factory.h" 7 #include "content/renderer/media/mock_media_constraint_factory.h"
8 #include "content/renderer/media/webrtc/webrtc_local_audio_track_adapter.h" 8 #include "content/renderer/media/webrtc/webrtc_local_audio_track_adapter.h"
9 #include "content/renderer/media/webrtc_audio_capturer.h" 9 #include "content/renderer/media/webrtc_audio_capturer.h"
10 #include "content/renderer/media/webrtc_local_audio_track.h" 10 #include "content/renderer/media/webrtc_local_audio_track.h"
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 capturer_ = WebRtcAudioCapturer::CreateCapturer( 78 capturer_ = WebRtcAudioCapturer::CreateCapturer(
79 -1, StreamDeviceInfo(MEDIA_DEVICE_AUDIO_CAPTURE, 79 -1, StreamDeviceInfo(MEDIA_DEVICE_AUDIO_CAPTURE,
80 "", "", params_.sample_rate(), 80 "", "", params_.sample_rate(),
81 params_.channel_layout(), 81 params_.channel_layout(),
82 params_.frames_per_buffer()), 82 params_.frames_per_buffer()),
83 constraints, NULL, NULL); 83 constraints, NULL, NULL);
84 capturer_source_ = new MockCapturerSource(); 84 capturer_source_ = new MockCapturerSource();
85 EXPECT_CALL(*capturer_source_.get(), Initialize(_, capturer_.get(), -1)); 85 EXPECT_CALL(*capturer_source_.get(), Initialize(_, capturer_.get(), -1));
86 EXPECT_CALL(*capturer_source_.get(), SetAutomaticGainControl(true)); 86 EXPECT_CALL(*capturer_source_.get(), SetAutomaticGainControl(true));
87 EXPECT_CALL(*capturer_source_.get(), Start()); 87 EXPECT_CALL(*capturer_source_.get(), Start());
88 capturer_->SetCapturerSourceForTesting(capturer_source_, params_); 88 capturer_->SetCapturerSource(capturer_source_, params_);
89 89
90 scoped_refptr<WebRtcLocalAudioTrackAdapter> adapter( 90 scoped_refptr<WebRtcLocalAudioTrackAdapter> adapter(
91 WebRtcLocalAudioTrackAdapter::Create(std::string(), NULL)); 91 WebRtcLocalAudioTrackAdapter::Create(std::string(), NULL));
92 track_.reset(new WebRtcLocalAudioTrack(adapter.get(), capturer_, NULL)); 92 track_.reset(new WebRtcLocalAudioTrack(adapter.get(), capturer_, NULL));
93 track_->Start(); 93 track_->Start();
94 94
95 // Connect a mock sink to the track. 95 // Connect a mock sink to the track.
96 scoped_ptr<MockMediaStreamAudioSink> sink(new MockMediaStreamAudioSink()); 96 scoped_ptr<MockMediaStreamAudioSink> sink(new MockMediaStreamAudioSink());
97 track_->AddSink(sink.get()); 97 track_->AddSink(sink.get());
98 98
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 "", "", params_.sample_rate(), 142 "", "", params_.sample_rate(),
143 params_.channel_layout(), 143 params_.channel_layout(),
144 params_.frames_per_buffer()), 144 params_.frames_per_buffer()),
145 constraint_factory.CreateWebMediaConstraints(), NULL, NULL) 145 constraint_factory.CreateWebMediaConstraints(), NULL, NULL)
146 ); 146 );
147 EXPECT_TRUE(capturer.get() == NULL); 147 EXPECT_TRUE(capturer.get() == NULL);
148 } 148 }
149 149
150 150
151 } // namespace content 151 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/media/webrtc_audio_capturer.cc ('k') | content/renderer/media/webrtc_local_audio_track_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698