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

Unified Diff: webrtc/test/call_test.cc

Issue 2652803002: Refactor FakeAudioDevice to have separate methods for starting recording and playout. (Closed)
Patch Set: Addressed comments. Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: webrtc/test/call_test.cc
diff --git a/webrtc/test/call_test.cc b/webrtc/test/call_test.cc
index 9521d3430d3fee35da27093961001f377f2f29a4..8d1f4f1bf5ee362177944a942888ff83576cceb0 100644
--- a/webrtc/test/call_test.cc
+++ b/webrtc/test/call_test.cc
@@ -140,14 +140,14 @@ void CallTest::Start() {
for (VideoReceiveStream* video_recv_stream : video_receive_streams_)
video_recv_stream->Start();
if (audio_send_stream_) {
- fake_send_audio_device_->Start();
+ fake_send_audio_device_->StartRecordingSine(1000, 256);
audio_send_stream_->Start();
EXPECT_EQ(0, voe_send_.base->StartSend(voe_send_.channel_id));
}
for (AudioReceiveStream* audio_recv_stream : audio_receive_streams_)
audio_recv_stream->Start();
if (!audio_receive_streams_.empty()) {
- fake_recv_audio_device_->Start();
+ fake_recv_audio_device_->StartPlayout();
EXPECT_EQ(0, voe_recv_.base->StartPlayout(voe_recv_.channel_id));
}
for (FlexfecReceiveStream* flexfec_recv_stream : flexfec_receive_streams_)
@@ -162,13 +162,13 @@ void CallTest::Stop() {
for (FlexfecReceiveStream* flexfec_recv_stream : flexfec_receive_streams_)
flexfec_recv_stream->Stop();
if (!audio_receive_streams_.empty()) {
- fake_recv_audio_device_->Stop();
+ fake_recv_audio_device_->StopPlayout();
EXPECT_EQ(0, voe_recv_.base->StopPlayout(voe_recv_.channel_id));
}
for (AudioReceiveStream* audio_recv_stream : audio_receive_streams_)
audio_recv_stream->Stop();
if (audio_send_stream_) {
- fake_send_audio_device_->Stop();
+ fake_send_audio_device_->StopRecording();
EXPECT_EQ(0, voe_send_.base->StopSend(voe_send_.channel_id));
audio_send_stream_->Stop();
}
@@ -309,12 +309,10 @@ void CallTest::CreateFrameGeneratorCapturer(int framerate,
}
void CallTest::CreateFakeAudioDevices() {
- fake_send_audio_device_.reset(new FakeAudioDevice(
- clock_, test::ResourcePath("voice_engine/audio_long16", "pcm"),
- DriftingClock::kNoDrift));
- fake_recv_audio_device_.reset(new FakeAudioDevice(
- clock_, test::ResourcePath("voice_engine/audio_long16", "pcm"),
- DriftingClock::kNoDrift));
+ fake_send_audio_device_.reset(
+ new FakeAudioDevice(clock_, DriftingClock::kNoDrift));
+ fake_recv_audio_device_.reset(
+ new FakeAudioDevice(clock_, DriftingClock::kNoDrift));
}
void CallTest::CreateVideoStreams() {

Powered by Google App Engine
This is Rietveld 408576698