Remove VideoSendStreamTest.ProducesStats.

This test is covered by EndToEndTests.GetStats and there's no need for a
duplicate test.

BUG=
R=stefan@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#8332}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8332 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
pbos@webrtc.org 2015-02-11 14:24:44 +00:00
parent 9d94a0c736
commit fbcb5ceb16

View File

@ -915,88 +915,6 @@ TEST_F(VideoSendStreamTest, NoPaddingWhenVideoIsMuted) {
RunBaseTest(&test); RunBaseTest(&test);
} }
TEST_F(VideoSendStreamTest, ProducesStats) {
class ProducesStats : public test::SendTest {
public:
ProducesStats()
: SendTest(kDefaultTimeoutMs),
stream_(NULL),
event_(EventWrapper::Create()) {}
virtual Action OnSendRtcp(const uint8_t* packet, size_t length) OVERRIDE {
event_->Set();
return SEND_PACKET;
}
private:
bool WaitForFilledStats() {
Clock* clock = Clock::GetRealTimeClock();
int64_t now = clock->TimeInMilliseconds();
int64_t stop_time = now + kDefaultTimeoutMs;
while (now < stop_time) {
int64_t time_left = stop_time - now;
if (time_left > 0 && event_->Wait(time_left) == kEventSignaled &&
CheckStats()) {
return true;
}
now = clock->TimeInMilliseconds();
}
return false;
}
bool CheckStats() {
VideoSendStream::Stats stats = stream_->GetStats();
// Check that all applicable data sources have been used.
if (stats.input_frame_rate > 0 && stats.encode_frame_rate > 0
&& !stats.substreams.empty()) {
uint32_t ssrc = stats.substreams.begin()->first;
EXPECT_NE(
config_.rtp.ssrcs.end(),
std::find(
config_.rtp.ssrcs.begin(), config_.rtp.ssrcs.end(), ssrc));
// Check for data populated by various sources. RTCP excluded as this
// data is received from remote side. Tested in call tests instead.
const SsrcStats& entry = stats.substreams[ssrc];
if (entry.frame_counts.key_frames > 0 &&
entry.frame_counts.delta_frames > 0 &&
entry.total_bitrate_bps > 0 &&
entry.rtp_stats.transmitted.packets > 0u &&
entry.avg_delay_ms > 0 && entry.max_delay_ms > 0) {
return true;
}
}
return false;
}
void SetConfig(const VideoSendStream::Config& config) { config_ = config; }
virtual void ModifyConfigs(
VideoSendStream::Config* send_config,
std::vector<VideoReceiveStream::Config>* receive_configs,
VideoEncoderConfig* encoder_config) OVERRIDE {
SetConfig(*send_config);
}
virtual void OnStreamsCreated(
VideoSendStream* send_stream,
const std::vector<VideoReceiveStream*>& receive_streams) OVERRIDE {
stream_ = send_stream;
}
virtual void PerformTest() OVERRIDE {
EXPECT_TRUE(WaitForFilledStats())
<< "Timed out waiting for filled statistics.";
}
VideoSendStream* stream_;
VideoSendStream::Config config_;
scoped_ptr<EventWrapper> event_;
} test;
RunBaseTest(&test);
}
// This test first observes "high" bitrate use at which point it sends a REMB to // This test first observes "high" bitrate use at which point it sends a REMB to
// indicate that it should be lowered significantly. The test then observes that // indicate that it should be lowered significantly. The test then observes that
// the bitrate observed is sinking well below the min-transmit-bitrate threshold // the bitrate observed is sinking well below the min-transmit-bitrate threshold