Add tests for the RBE RemoveStream() API.

BUG=
R=stefan@webrtc.org

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

git-svn-id: http://webrtc.googlecode.com/svn/trunk@5812 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
solenberg@webrtc.org 2014-03-31 13:33:39 +00:00
parent d0a81d91ff
commit caeae4680c

View File

@ -341,6 +341,10 @@ void RemoteBitrateEstimatorTest::InitialBehaviorTestHelper(
EXPECT_TRUE(bitrate_observer_->updated());
bitrate_observer_->Reset();
EXPECT_EQ(bitrate_observer_->latest_bitrate(), bitrate_bps);
bitrate_estimator_->RemoveStream(kDefaultSsrc);
EXPECT_TRUE(bitrate_estimator_->LatestEstimate(&ssrcs, &bitrate_bps));
ASSERT_EQ(0u, ssrcs.size());
EXPECT_EQ(0u, bitrate_bps);
}
void RemoteBitrateEstimatorTest::RateIncreaseReorderingTestHelper(
@ -487,5 +491,21 @@ void RemoteBitrateEstimatorTest::CapacityDropTestHelper(
EXPECT_EQ(expected_bitrate_drop_delta,
bitrate_drop_time - overuse_start_time);
// Remove stream one by one.
unsigned int latest_bps = 0;
std::vector<unsigned int> ssrcs;
for (int i = 0; i < number_of_streams; i++) {
EXPECT_TRUE(bitrate_estimator_->LatestEstimate(&ssrcs, &latest_bps));
EXPECT_EQ(number_of_streams - i, static_cast<int>(ssrcs.size()));
EXPECT_EQ(bitrate_bps, latest_bps);
for (int j = i; j < number_of_streams; j++) {
EXPECT_EQ(kDefaultSsrc + j, ssrcs[j - i]);
}
bitrate_estimator_->RemoveStream(kDefaultSsrc + i);
}
EXPECT_TRUE(bitrate_estimator_->LatestEstimate(&ssrcs, &latest_bps));
EXPECT_EQ(0u, ssrcs.size());
EXPECT_EQ(0u, latest_bps);
}
} // namespace webrtc