Chromium Code Reviews| Index: webrtc/media/engine/webrtcvoiceengine_unittest.cc |
| diff --git a/webrtc/media/engine/webrtcvoiceengine_unittest.cc b/webrtc/media/engine/webrtcvoiceengine_unittest.cc |
| index 2db70d1521758ecb27c56aec3add98ca058740f0..1ec3e4b527f89f2bd3e4c82ee3423f0a3c4acaa2 100644 |
| --- a/webrtc/media/engine/webrtcvoiceengine_unittest.cc |
| +++ b/webrtc/media/engine/webrtcvoiceengine_unittest.cc |
| @@ -753,14 +753,12 @@ TEST_F(WebRtcVoiceEngineTestFake, SetRecvCodecsWhilePlaying) { |
| parameters.codecs.push_back(kIsacCodec); |
| parameters.codecs.push_back(kCn16000Codec); |
| EXPECT_TRUE(channel_->SetRecvParameters(parameters)); |
| - EXPECT_TRUE(channel_->SetPlayout(true)); |
| + channel_->SetPlayout(true); |
| EXPECT_TRUE(channel_->SetRecvParameters(parameters)); |
| // Changing the payload type of a codec should fail. |
| parameters.codecs[0].id = 127; |
| EXPECT_FALSE(channel_->SetRecvParameters(parameters)); |
| - int channel_num = voe_.GetLastChannel(); |
| - EXPECT_TRUE(voe_.GetPlayout(channel_num)); |
| } |
| // Test that we can add a codec while playing. |
| @@ -770,12 +768,10 @@ TEST_F(WebRtcVoiceEngineTestFake, AddRecvCodecsWhilePlaying) { |
| parameters.codecs.push_back(kIsacCodec); |
| parameters.codecs.push_back(kCn16000Codec); |
| EXPECT_TRUE(channel_->SetRecvParameters(parameters)); |
| - EXPECT_TRUE(channel_->SetPlayout(true)); |
| + channel_->SetPlayout(true); |
| parameters.codecs.push_back(kOpusCodec); |
| EXPECT_TRUE(channel_->SetRecvParameters(parameters)); |
| - int channel_num = voe_.GetLastChannel(); |
| - EXPECT_TRUE(voe_.GetPlayout(channel_num)); |
|
aleloi
2016/08/04 09:08:31
voe_ is a fake WebRTCVoiceEngine, which is a Voice
the sun
2016/08/04 09:44:44
I suggest you instead implement the Start()/Stop()
aleloi
2016/08/04 11:38:59
I did exactly as you suggested. The tests are back
|
| webrtc::CodecInst gcodec; |
| EXPECT_TRUE(cricket::WebRtcVoiceEngine::ToCodecInst(kOpusCodec, &gcodec)); |
| EXPECT_EQ(kOpusCodec.id, gcodec.pltype); |
| @@ -2170,17 +2166,6 @@ TEST_F(WebRtcVoiceEngineTestFake, SendStateWhenStreamsAreRecreated) { |
| EXPECT_FALSE(GetSendStream(kSsrc1).IsSending()); |
| } |
| -// Test that we can create a channel and start playing out on it. |
| -TEST_F(WebRtcVoiceEngineTestFake, Playout) { |
| - EXPECT_TRUE(SetupRecvStream()); |
| - int channel_num = voe_.GetLastChannel(); |
| - EXPECT_TRUE(channel_->SetRecvParameters(recv_parameters_)); |
| - EXPECT_TRUE(channel_->SetPlayout(true)); |
| - EXPECT_TRUE(voe_.GetPlayout(channel_num)); |
| - EXPECT_TRUE(channel_->SetPlayout(false)); |
| - EXPECT_FALSE(voe_.GetPlayout(channel_num)); |
| -} |
| - |
| // Test that we can add and remove send streams. |
| TEST_F(WebRtcVoiceEngineTestFake, CreateAndDeleteMultipleSendStreams) { |
| SetupForMultiSendStream(); |
| @@ -2328,56 +2313,6 @@ TEST_F(WebRtcVoiceEngineTestFake, GetStatsWithMultipleSendStreams) { |
| } |
| } |
| -// Test that we can add and remove receive streams, and do proper send/playout. |
| -// We can receive on multiple streams while sending one stream. |
| -TEST_F(WebRtcVoiceEngineTestFake, PlayoutWithMultipleStreams) { |
| - EXPECT_TRUE(SetupSendStream()); |
| - int channel_num1 = voe_.GetLastChannel(); |
| - |
| - // Start playout without a receive stream. |
| - EXPECT_TRUE(channel_->SetSendParameters(send_parameters_)); |
| - EXPECT_TRUE(channel_->SetPlayout(true)); |
| - EXPECT_FALSE(voe_.GetPlayout(channel_num1)); |
| - |
| - // Adding another stream should enable playout on the new stream only. |
| - EXPECT_TRUE(AddRecvStream(kSsrc2)); |
| - int channel_num2 = voe_.GetLastChannel(); |
| - SetSend(channel_, true); |
| - EXPECT_TRUE(GetSendStream(kSsrc1).IsSending()); |
| - |
| - // Make sure only the new stream is played out. |
| - EXPECT_FALSE(voe_.GetPlayout(channel_num1)); |
| - EXPECT_TRUE(voe_.GetPlayout(channel_num2)); |
| - |
| - // Adding yet another stream should have stream 2 and 3 enabled for playout. |
| - EXPECT_TRUE(AddRecvStream(kSsrc3)); |
| - int channel_num3 = voe_.GetLastChannel(); |
| - EXPECT_FALSE(voe_.GetPlayout(channel_num1)); |
| - EXPECT_TRUE(voe_.GetPlayout(channel_num2)); |
| - EXPECT_TRUE(voe_.GetPlayout(channel_num3)); |
| - |
| - // Stop sending. |
| - SetSend(channel_, false); |
| - EXPECT_FALSE(GetSendStream(kSsrc1).IsSending()); |
| - |
| - // Stop playout. |
| - EXPECT_TRUE(channel_->SetPlayout(false)); |
| - EXPECT_FALSE(voe_.GetPlayout(channel_num1)); |
| - EXPECT_FALSE(voe_.GetPlayout(channel_num2)); |
| - EXPECT_FALSE(voe_.GetPlayout(channel_num3)); |
| - |
| - // Restart playout and make sure only recv streams are played out. |
| - EXPECT_TRUE(channel_->SetPlayout(true)); |
| - EXPECT_FALSE(voe_.GetPlayout(channel_num1)); |
| - EXPECT_TRUE(voe_.GetPlayout(channel_num2)); |
| - EXPECT_TRUE(voe_.GetPlayout(channel_num3)); |
| - |
| - // Now remove the recv streams and verify that the send stream doesn't play. |
| - EXPECT_TRUE(channel_->RemoveRecvStream(3)); |
| - EXPECT_TRUE(channel_->RemoveRecvStream(2)); |
| - EXPECT_FALSE(voe_.GetPlayout(channel_num1)); |
| -} |
| - |
| // Test that we can create a channel configured for Codian bridges, |
| // and start sending on it. |
| TEST_F(WebRtcVoiceEngineTestFake, CodianSend) { |
| @@ -2741,18 +2676,6 @@ TEST_F(WebRtcVoiceEngineTestFake, InsertDtmfOnSendStreamAsCallee) { |
| TestInsertDtmf(kSsrc1, false); |
| } |
| -TEST_F(WebRtcVoiceEngineTestFake, TestSetPlayoutError) { |
| - EXPECT_TRUE(SetupSendStream()); |
| - EXPECT_TRUE(channel_->SetSendParameters(send_parameters_)); |
| - SetSend(channel_, true); |
| - EXPECT_TRUE(AddRecvStream(2)); |
| - EXPECT_TRUE(AddRecvStream(3)); |
| - EXPECT_TRUE(channel_->SetPlayout(true)); |
| - voe_.set_playout_fail_channel(voe_.GetLastChannel() - 1); |
| - EXPECT_TRUE(channel_->SetPlayout(false)); |
| - EXPECT_FALSE(channel_->SetPlayout(true)); |
| -} |
| - |
| TEST_F(WebRtcVoiceEngineTestFake, SetAudioOptions) { |
| EXPECT_TRUE(SetupSendStream()); |
| EXPECT_CALL(adm_, |