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

Unified Diff: content/renderer/media/webrtc_audio_capturer_unittest.cc

Issue 90743004: Add generic interfaces for the sinks of the media stream audio track (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed the nits. Created 7 years 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 side-by-side diff with in-line comments
Download patch
Index: content/renderer/media/webrtc_audio_capturer_unittest.cc
diff --git a/content/renderer/media/webrtc_audio_capturer_unittest.cc b/content/renderer/media/webrtc_audio_capturer_unittest.cc
index 01c8b48a96d857b78e5d6b7b11ad2a2344e6178a..cc7d528912567736b513c9aaf1d0a5f754b60882 100644
--- a/content/renderer/media/webrtc_audio_capturer_unittest.cc
+++ b/content/renderer/media/webrtc_audio_capturer_unittest.cc
@@ -65,20 +65,20 @@ class MockCapturerSource : public media::AudioCapturerSource {
virtual ~MockCapturerSource() {}
};
-class MockWebRtcAudioCapturerSink : public WebRtcAudioCapturerSink {
+class MockPeerConnectionAudioSink : public PeerConnectionAudioSink {
public:
- MockWebRtcAudioCapturerSink() {}
- ~MockWebRtcAudioCapturerSink() {}
- MOCK_METHOD9(CaptureData, int(const std::vector<int>& channels,
- const int16* audio_data,
- int sample_rate,
- int number_of_channels,
- int number_of_frames,
- int audio_delay_milliseconds,
- int current_volume,
- bool need_audio_processing,
- bool key_pressed));
- MOCK_METHOD1(SetCaptureFormat, void(const media::AudioParameters& params));
+ MockPeerConnectionAudioSink() {}
+ ~MockPeerConnectionAudioSink() {}
+ MOCK_METHOD9(OnData, int(const int16* audio_data,
+ int sample_rate,
+ int number_of_channels,
+ int number_of_frames,
+ const std::vector<int>& channels,
+ int audio_delay_milliseconds,
+ int current_volume,
+ bool need_audio_processing,
+ bool key_pressed));
+ MOCK_METHOD1(OnSetFormat, void(const media::AudioParameters& params));
};
} // namespace
@@ -125,8 +125,8 @@ class WebRtcAudioCapturerTest : public testing::Test {
// those values should be correctly stored and passed to the track.
TEST_F(WebRtcAudioCapturerTest, VerifyAudioParams) {
// Connect a mock sink to the track.
- scoped_ptr<MockWebRtcAudioCapturerSink> sink(
- new MockWebRtcAudioCapturerSink());
+ scoped_ptr<MockPeerConnectionAudioSink> sink(
+ new MockPeerConnectionAudioSink());
track_->AddSink(sink.get());
int delay_ms = 65;
@@ -146,12 +146,12 @@ TEST_F(WebRtcAudioCapturerTest, VerifyAudioParams) {
media::AudioCapturerSource::CaptureCallback* callback =
static_cast<media::AudioCapturerSource::CaptureCallback*>(capturer_);
// Verify the sink is getting the correct values.
- EXPECT_CALL(*sink, SetCaptureFormat(_));
+ EXPECT_CALL(*sink, OnSetFormat(_));
EXPECT_CALL(*sink,
- CaptureData(_, _, params_.sample_rate(), params_.channels(),
- expected_buffer_size, delay_ms,
- expected_volume_value, expected_need_audio_processing,
- key_pressed)).Times(AtLeast(1));
+ OnData(_, params_.sample_rate(), params_.channels(),
+ expected_buffer_size, _, delay_ms,
+ expected_volume_value, expected_need_audio_processing,
+ key_pressed)).Times(AtLeast(1));
callback->Capture(audio_bus.get(), delay_ms, volume, key_pressed);
// Verify the cached values in the capturer fits what we expect.
« no previous file with comments | « content/renderer/media/webrtc_audio_capturer_sink_owner.cc ('k') | content/renderer/media/webrtc_audio_device_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698