From fbcb5ceb166ed6b51be1da366817d64ecc86927a Mon Sep 17 00:00:00 2001 From: "pbos@webrtc.org" Date: Wed, 11 Feb 2015 14:24:44 +0000 Subject: [PATCH] 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 --- webrtc/video/video_send_stream_tests.cc | 82 ------------------------- 1 file changed, 82 deletions(-) diff --git a/webrtc/video/video_send_stream_tests.cc b/webrtc/video/video_send_stream_tests.cc index a6d77543f5..79904ef184 100644 --- a/webrtc/video/video_send_stream_tests.cc +++ b/webrtc/video/video_send_stream_tests.cc @@ -915,88 +915,6 @@ TEST_F(VideoSendStreamTest, NoPaddingWhenVideoIsMuted) { 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* receive_configs, - VideoEncoderConfig* encoder_config) OVERRIDE { - SetConfig(*send_config); - } - - virtual void OnStreamsCreated( - VideoSendStream* send_stream, - const std::vector& 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 event_; - } test; - - RunBaseTest(&test); -} - // 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 // the bitrate observed is sinking well below the min-transmit-bitrate threshold