Chromium Code Reviews| Index: webrtc/modules/audio_coding/neteq/neteq_impl_unittest.cc |
| diff --git a/webrtc/modules/audio_coding/neteq/neteq_impl_unittest.cc b/webrtc/modules/audio_coding/neteq/neteq_impl_unittest.cc |
| index 1353d108eab941100a7fc14051b5235c1d840326..3a2710fde6e4579de3f489327d44d561eb10f7ce 100644 |
| --- a/webrtc/modules/audio_coding/neteq/neteq_impl_unittest.cc |
| +++ b/webrtc/modules/audio_coding/neteq/neteq_impl_unittest.cc |
| @@ -666,6 +666,12 @@ TEST_F(NetEqImplTest, CodecInternalCng) { |
| EXPECT_CALL(mock_decoder, Channels()).WillRepeatedly(Return(1)); |
| EXPECT_CALL(mock_decoder, IncomingPacket(_, kPayloadLengthBytes, _, _, _)) |
| .WillRepeatedly(Return(0)); |
| + EXPECT_CALL(mock_decoder, PacketDuration(_, kPayloadLengthBytes)) |
|
hlundin-webrtc
2016/04/06 11:13:58
These new EXPEC_CALLs are unrelated to this CL, bu
|
| + .WillRepeatedly(Return(kPayloadLengthSamples)); |
| + // Packed duration when asking the decoder for more CNG data (without a new |
| + // packet). |
| + EXPECT_CALL(mock_decoder, PacketDuration(nullptr, 0)) |
| + .WillRepeatedly(Return(kPayloadLengthSamples)); |
| // Pointee(x) verifies that first byte of the payload equals x, this makes it |
| // possible to verify that the correct payload is fed to Decode(). |
| @@ -736,13 +742,16 @@ TEST_F(NetEqImplTest, CodecInternalCng) { |
| ASSERT_EQ(kMaxOutputSize, output.samples_per_channel_); |
| EXPECT_EQ(1u, output.num_channels_); |
| EXPECT_EQ(expected_type[i - 1], output.speech_type_); |
| - rtc::Optional<uint32_t> timestamp = neteq_->GetPlayoutTimestamp(); |
| - EXPECT_TRUE(timestamp); |
| EXPECT_EQ(NetEq::kOK, neteq_->GetAudio(&output)); |
| - timestamp = neteq_->GetPlayoutTimestamp(); |
| - ASSERT_TRUE(timestamp); |
| - EXPECT_EQ(*timestamp, *last_timestamp + expected_timestamp_increment[i]); |
| - last_timestamp = timestamp; |
| + rtc::Optional<uint32_t> timestamp = neteq_->GetPlayoutTimestamp(); |
| + if (output.speech_type_ == AudioFrame::kNormalSpeech) { |
| + ASSERT_TRUE(timestamp); |
| + EXPECT_EQ(*timestamp, *last_timestamp + expected_timestamp_increment[i]); |
| + last_timestamp = timestamp; |
| + } else { |
| + // Expect to get an empty timestamp value during CNG and PLC. |
| + EXPECT_FALSE(timestamp); |
| + } |
| } |
| // Insert third packet, which leaves a gap from last packet. |