Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(83)

Side by Side Diff: webrtc/video/send_statistics_proxy_unittest.cc

Issue 2430603003: Implement qpSum stat for video send ssrc stats. (Closed)
Patch Set: Statscollector send ssrc unittest for qp_sum Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 TEST_F(SendStatisticsProxyTest, OnSendEncodedImageIncreasesFramesEncoded) { 304 TEST_F(SendStatisticsProxyTest, OnSendEncodedImageIncreasesFramesEncoded) {
305 EncodedImage encoded_image; 305 EncodedImage encoded_image;
306 CodecSpecificInfo codec_info; 306 CodecSpecificInfo codec_info;
307 EXPECT_EQ(0, statistics_proxy_->GetStats().frames_encoded); 307 EXPECT_EQ(0, statistics_proxy_->GetStats().frames_encoded);
308 for (int i = 1; i <= 3; ++i) { 308 for (int i = 1; i <= 3; ++i) {
309 statistics_proxy_->OnSendEncodedImage(encoded_image, &codec_info); 309 statistics_proxy_->OnSendEncodedImage(encoded_image, &codec_info);
310 EXPECT_EQ(i, statistics_proxy_->GetStats().frames_encoded); 310 EXPECT_EQ(i, statistics_proxy_->GetStats().frames_encoded);
311 } 311 }
312 } 312 }
313 313
314 TEST_F(SendStatisticsProxyTest, OnSendEncodedImageIncreasesQpSum) {
315 EncodedImage encoded_image;
316 CodecSpecificInfo codec_info;
317 EXPECT_EQ(0, statistics_proxy_->GetStats().qp_sum);
318 encoded_image.qp_ = 3;
319 statistics_proxy_->OnSendEncodedImage(encoded_image, &codec_info);
320 EXPECT_EQ(3, statistics_proxy_->GetStats().qp_sum);
321 encoded_image.qp_ = 127;
322 statistics_proxy_->OnSendEncodedImage(encoded_image, &codec_info);
323 EXPECT_EQ(130, statistics_proxy_->GetStats().qp_sum);
324 }
325
314 TEST_F(SendStatisticsProxyTest, SwitchContentTypeUpdatesHistograms) { 326 TEST_F(SendStatisticsProxyTest, SwitchContentTypeUpdatesHistograms) {
315 const int kWidth = 640; 327 const int kWidth = 640;
316 const int kHeight = 480; 328 const int kHeight = 480;
317 329
318 for (int i = 0; i < kMinRequiredSamples; ++i) 330 for (int i = 0; i < kMinRequiredSamples; ++i)
319 statistics_proxy_->OnIncomingFrame(kWidth, kHeight); 331 statistics_proxy_->OnIncomingFrame(kWidth, kHeight);
320 332
321 // No switch, stats should not be updated. 333 // No switch, stats should not be updated.
322 VideoEncoderConfig config; 334 VideoEncoderConfig config;
323 config.content_type = VideoEncoderConfig::ContentType::kRealtimeVideo; 335 config.content_type = VideoEncoderConfig::ContentType::kRealtimeVideo;
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after
767 779
768 EXPECT_EQ( 780 EXPECT_EQ(
769 1, metrics::NumSamples("WebRTC.Video.Screenshare.FecBitrateSentInKbps")); 781 1, metrics::NumSamples("WebRTC.Video.Screenshare.FecBitrateSentInKbps"));
770 EXPECT_EQ(1, metrics::NumEvents( 782 EXPECT_EQ(1, metrics::NumEvents(
771 "WebRTC.Video.Screenshare.FecBitrateSentInKbps", 783 "WebRTC.Video.Screenshare.FecBitrateSentInKbps",
772 static_cast<int>((rtx_counters.fec.TotalBytes() * 2 * 8) / 784 static_cast<int>((rtx_counters.fec.TotalBytes() * 2 * 8) /
773 metrics::kMinRunTimeInSeconds / 1000))); 785 metrics::kMinRunTimeInSeconds / 1000)));
774 } 786 }
775 787
776 } // namespace webrtc 788 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698