Fix flakiness in network up/down event tests when running under memcheck.

TBR=pwestin@webrtc.org

BUG=1524

Review URL: https://webrtc-codereview.appspot.com/1261005

git-svn-id: http://webrtc.googlecode.com/svn/trunk@3732 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
stefan@webrtc.org 2013-03-27 17:01:48 +00:00
parent add50b94a5
commit e1a7193869
2 changed files with 18 additions and 7 deletions

View File

@ -603,7 +603,6 @@ void RTPSender::TimeToSendPacket(uint16_t sequence_number,
}
if (!packet_history_->GetRTPPacket(sequence_number, 0, data_buffer, &length,
&stored_time_ms, &type)) {
assert(false);
return;
}
assert(length > 0);

View File

@ -380,7 +380,9 @@ void ViEAutoTest::ViERtpRtcpStandardTest()
EXPECT_EQ(0, ViE.rtp_rtcp->GetBandwidthUsage(
tbChannel.videoChannel, sentTotalBitrate, sentVideoBitrate,
sentFecBitrate, sentNackBitrate));
EXPECT_GT(sentTotalBitrate, 0u);
if (FLAGS_include_timing_dependent_tests) {
EXPECT_GT(sentTotalBitrate, 0u);
}
// Simulate lost reception and verify that nothing is sent during that time.
ViE.network->SetNetworkTransmissionState(tbChannel.videoChannel, false);
ViETest::Log("Network Down...\n");
@ -388,7 +390,9 @@ void ViEAutoTest::ViERtpRtcpStandardTest()
EXPECT_EQ(0, ViE.rtp_rtcp->GetBandwidthUsage(
tbChannel.videoChannel, sentTotalBitrate, sentVideoBitrate,
sentFecBitrate, sentNackBitrate));
EXPECT_EQ(sentTotalBitrate, 0u);
if (FLAGS_include_timing_dependent_tests) {
EXPECT_EQ(sentTotalBitrate, 0u);
}
// Network reception back. Video should now be sent.
ViE.network->SetNetworkTransmissionState(tbChannel.videoChannel, true);
@ -397,7 +401,9 @@ void ViEAutoTest::ViERtpRtcpStandardTest()
EXPECT_EQ(0, ViE.rtp_rtcp->GetBandwidthUsage(
tbChannel.videoChannel, sentTotalBitrate, sentVideoBitrate,
sentFecBitrate, sentNackBitrate));
EXPECT_GT(sentTotalBitrate, 0u);
if (FLAGS_include_timing_dependent_tests) {
EXPECT_GT(sentTotalBitrate, 0u);
}
// Buffering mode.
EXPECT_EQ(0, ViE.base->StopSend(tbChannel.videoChannel));
@ -415,7 +421,9 @@ void ViEAutoTest::ViERtpRtcpStandardTest()
EXPECT_EQ(0, ViE.rtp_rtcp->GetBandwidthUsage(
tbChannel.videoChannel, sentTotalBitrate, sentVideoBitrate,
sentFecBitrate, sentNackBitrate));
EXPECT_GT(sentTotalBitrate, 0u);
if (FLAGS_include_timing_dependent_tests) {
EXPECT_GT(sentTotalBitrate, 0u);
}
// Simulate lost reception and verify that nothing is sent during that time.
ViETest::Log("Network Down...\n");
ViE.network->SetNetworkTransmissionState(tbChannel.videoChannel, false);
@ -423,7 +431,9 @@ void ViEAutoTest::ViERtpRtcpStandardTest()
EXPECT_EQ(0, ViE.rtp_rtcp->GetBandwidthUsage(
tbChannel.videoChannel, sentTotalBitrate, sentVideoBitrate,
sentFecBitrate, sentNackBitrate));
EXPECT_EQ(sentTotalBitrate, 0u);
if (FLAGS_include_timing_dependent_tests) {
EXPECT_EQ(sentTotalBitrate, 0u);
}
// Network reception back. Video should now be sent.
ViETest::Log("Network Up...\n");
ViE.network->SetNetworkTransmissionState(tbChannel.videoChannel, true);
@ -431,7 +441,9 @@ void ViEAutoTest::ViERtpRtcpStandardTest()
EXPECT_EQ(0, ViE.rtp_rtcp->GetBandwidthUsage(
tbChannel.videoChannel, sentTotalBitrate, sentVideoBitrate,
sentFecBitrate, sentNackBitrate));
EXPECT_GT(sentTotalBitrate, 0u);
if (FLAGS_include_timing_dependent_tests) {
EXPECT_GT(sentTotalBitrate, 0u);
}
// TODO(holmer): Verify that the decoded framerate doesn't decrease on an
// outage when in buffering mode. This isn't currently possible because we
// don't have an API to get decoded framerate.