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

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

Issue 2421193003: Implement framesEncoded stat in video send ssrc stats. (Closed)
Patch Set: Change type of stat int -> uint32_t. 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
« no previous file with comments | « webrtc/video/send_statistics_proxy.cc ('k') | webrtc/video_send_stream.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 VideoSendStream::Stats stats = statistics_proxy_->GetStats(); 294 VideoSendStream::Stats stats = statistics_proxy_->GetStats();
295 EXPECT_EQ(0, stats.preferred_media_bitrate_bps); 295 EXPECT_EQ(0, stats.preferred_media_bitrate_bps);
296 const int kPreferredMediaBitrateBps = 50; 296 const int kPreferredMediaBitrateBps = 50;
297 297
298 VideoEncoderConfig config; 298 VideoEncoderConfig config;
299 statistics_proxy_->OnEncoderReconfigured(config, kPreferredMediaBitrateBps); 299 statistics_proxy_->OnEncoderReconfigured(config, kPreferredMediaBitrateBps);
300 stats = statistics_proxy_->GetStats(); 300 stats = statistics_proxy_->GetStats();
301 EXPECT_EQ(kPreferredMediaBitrateBps, stats.preferred_media_bitrate_bps); 301 EXPECT_EQ(kPreferredMediaBitrateBps, stats.preferred_media_bitrate_bps);
302 } 302 }
303 303
304 TEST_F(SendStatisticsProxyTest, OnSendEncodedImageIncreasesFramesEncoded) {
305 EncodedImage encoded_image;
306 CodecSpecificInfo codec_info;
307 EXPECT_EQ(0u, statistics_proxy_->GetStats().frames_encoded);
308 for (uint32_t i = 1; i <= 3; ++i) {
309 statistics_proxy_->OnSendEncodedImage(encoded_image, &codec_info);
310 EXPECT_EQ(i, statistics_proxy_->GetStats().frames_encoded);
311 }
312 }
313
304 TEST_F(SendStatisticsProxyTest, SwitchContentTypeUpdatesHistograms) { 314 TEST_F(SendStatisticsProxyTest, SwitchContentTypeUpdatesHistograms) {
305 const int kWidth = 640; 315 const int kWidth = 640;
306 const int kHeight = 480; 316 const int kHeight = 480;
307 317
308 for (int i = 0; i < kMinRequiredSamples; ++i) 318 for (int i = 0; i < kMinRequiredSamples; ++i)
309 statistics_proxy_->OnIncomingFrame(kWidth, kHeight); 319 statistics_proxy_->OnIncomingFrame(kWidth, kHeight);
310 320
311 // No switch, stats should not be updated. 321 // No switch, stats should not be updated.
312 VideoEncoderConfig config; 322 VideoEncoderConfig config;
313 config.content_type = VideoEncoderConfig::ContentType::kRealtimeVideo; 323 config.content_type = VideoEncoderConfig::ContentType::kRealtimeVideo;
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after
757 767
758 EXPECT_EQ( 768 EXPECT_EQ(
759 1, metrics::NumSamples("WebRTC.Video.Screenshare.FecBitrateSentInKbps")); 769 1, metrics::NumSamples("WebRTC.Video.Screenshare.FecBitrateSentInKbps"));
760 EXPECT_EQ(1, metrics::NumEvents( 770 EXPECT_EQ(1, metrics::NumEvents(
761 "WebRTC.Video.Screenshare.FecBitrateSentInKbps", 771 "WebRTC.Video.Screenshare.FecBitrateSentInKbps",
762 static_cast<int>((rtx_counters.fec.TotalBytes() * 2 * 8) / 772 static_cast<int>((rtx_counters.fec.TotalBytes() * 2 * 8) /
763 metrics::kMinRunTimeInSeconds / 1000))); 773 metrics::kMinRunTimeInSeconds / 1000)));
764 } 774 }
765 775
766 } // namespace webrtc 776 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/video/send_statistics_proxy.cc ('k') | webrtc/video_send_stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698