As expected, r6569 (https://code.google.com/p/webrtc/source/detail?r=6965) caused memcheck bots to complain. Adding expections for that, in line with outher peerconnection tests.

Also, caused some issues with other peerconnection_unittest tests, so changed the design of those.

BUG=
R=kjellander@webrtc.org, perkj@webrtc.org

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

git-svn-id: http://webrtc.googlecode.com/svn/trunk@6968 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
solenberg@webrtc.org 2014-08-25 14:35:40 +00:00
parent c23923447c
commit 6556a59db1
2 changed files with 34 additions and 18 deletions

View File

@ -1044,6 +1044,28 @@ class P2PTestConductor : public testing::Test {
}
}
// Wait until 'size' bytes of audio has been seen by the receiver, on the
// first audio stream.
void WaitForAudioData(int size) {
StreamCollectionInterface* local_streams =
initializing_client()->local_streams();
ASSERT_GT(local_streams->count(), 0u);
ASSERT_GT(local_streams->at(0)->GetAudioTracks().size(), 0u);
MediaStreamTrackInterface* local_audio_track =
local_streams->at(0)->GetAudioTracks()[0];
// Wait until *any* audio has been received.
EXPECT_TRUE_WAIT(
receiving_client()->GetBytesReceivedStats(local_audio_track) > 0,
kMaxWaitForAudioDataMs);
// Wait until 'size' number of bytes have been received.
size += receiving_client()->GetBytesReceivedStats(local_audio_track);
EXPECT_TRUE_WAIT(
receiving_client()->GetBytesReceivedStats(local_audio_track) > size,
kMaxWaitForAudioDataMs);
}
SignalingClass* initializing_client() { return initiating_client_.get(); }
SignalingClass* receiving_client() { return receiving_client_.get(); }
@ -1470,18 +1492,8 @@ TEST_F(JsepPeerConnectionP2PTestClient, ReceivedBweStatsAudio) {
receiving_client()->SetReceiveAudioVideo(true, false);
LocalP2PTest();
// Wait until we have received some audio data.
StreamCollectionInterface* local_streams =
initializing_client()->local_streams();
ASSERT_GT(local_streams->count(), 0u);
ASSERT_GT(local_streams->at(0)->GetAudioTracks().size(), 0u);
MediaStreamTrackInterface* local_audio_track =
local_streams->at(0)->GetAudioTracks()[0];
EXPECT_TRUE_WAIT(
receiving_client()->GetBytesReceivedStats(local_audio_track) > 10000,
kMaxWaitForAudioDataMs);
// Then wait for REMB.
// Wait until we have received some audio data. Following REMB shoud be zero.
WaitForAudioData(10000);
EXPECT_EQ_WAIT(
receiving_client()->GetAvailableReceivedBandwidthStats(), 0,
kMaxWaitForRembMs);
@ -1503,15 +1515,14 @@ TEST_F(JsepPeerConnectionP2PTestClient, ReceivedBweStatsCombined) {
EXPECT_TRUE_WAIT(
receiving_client()->GetAvailableReceivedBandwidthStats() > 40000,
kMaxWaitForRembMs);
int video_bw = receiving_client()->GetAvailableReceivedBandwidthStats();
// Halt video capturers, then run until we get a new non-zero bw which is
// lower than the previous value.
// Halt video capturers, then run until we have gotten some audio. Following
// REMB should be non-zero.
initializing_client()->StopVideoCapturers();
WaitForAudioData(10000);
EXPECT_TRUE_WAIT(
receiving_client()->GetAvailableReceivedBandwidthStats() < video_bw,
receiving_client()->GetAvailableReceivedBandwidthStats() > 0,
kMaxWaitForRembMs);
EXPECT_GT(receiving_client()->GetAvailableReceivedBandwidthStats(), 0);
}
// Test receive bandwidth stats with 1 video, 3 audio streams but no combined
@ -1532,8 +1543,10 @@ TEST_F(JsepPeerConnectionP2PTestClient, ReceivedBweStatsNotCombined) {
receiving_client()->GetAvailableReceivedBandwidthStats() > 40000,
kMaxWaitForRembMs);
// Halt video capturers, then run until we get a new bw which is zero.
// Halt video capturers, then run until we have gotten some audio. Following
// REMB should be zero.
initializing_client()->StopVideoCapturers();
WaitForAudioData(10000);
EXPECT_EQ_WAIT(
receiving_client()->GetAvailableReceivedBandwidthStats(), 0,
kMaxWaitForRembMs);

View File

@ -20,6 +20,9 @@ JsepPeerConnectionP2PTestClient.LocalP2PTestOfferSdesToDtls
JsepPeerConnectionP2PTestClient.LocalP2PTestOfferDtlsToSdes
JsepPeerConnectionP2PTestClient.LocalP2PTestWithoutMsid
JsepPeerConnectionP2PTestClient.LocalP2PTestWithVideoDecoderFactory
JsepPeerConnectionP2PTestClient.ReceivedBweStatsAudio
JsepPeerConnectionP2PTestClient.ReceivedBweStatsCombined
JsepPeerConnectionP2PTestClient.ReceivedBweStatsNotCombined
JsepPeerConnectionP2PTestClient.RegisterDataChannelObserver
JsepPeerConnectionP2PTestClient.UpdateOfferWithRejectedContent
PeerConnectionEndToEndTest.Call