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

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

Issue 1900193004: Remove VCMPacketizationCallback (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Rebased and fixed SendStatisics const uint. Created 4 years, 7 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/video_send_stream.cc » ('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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 callback->StatisticsUpdated(ssrc_stats.rtcp_stats, ssrc); 139 callback->StatisticsUpdated(ssrc_stats.rtcp_stats, ssrc);
140 } 140 }
141 VideoSendStream::Stats stats = statistics_proxy_->GetStats(); 141 VideoSendStream::Stats stats = statistics_proxy_->GetStats();
142 ExpectEqual(expected_, stats); 142 ExpectEqual(expected_, stats);
143 } 143 }
144 144
145 TEST_F(SendStatisticsProxyTest, EncodedBitrateAndFramerate) { 145 TEST_F(SendStatisticsProxyTest, EncodedBitrateAndFramerate) {
146 int media_bitrate_bps = 500; 146 int media_bitrate_bps = 500;
147 int encode_fps = 29; 147 int encode_fps = 29;
148 148
149 statistics_proxy_->OnOutgoingRate(encode_fps, media_bitrate_bps); 149 statistics_proxy_->OnEncoderStatsUpdate(encode_fps, media_bitrate_bps,
150 "encoder name");
150 151
151 VideoSendStream::Stats stats = statistics_proxy_->GetStats(); 152 VideoSendStream::Stats stats = statistics_proxy_->GetStats();
152 EXPECT_EQ(media_bitrate_bps, stats.media_bitrate_bps); 153 EXPECT_EQ(media_bitrate_bps, stats.media_bitrate_bps);
153 EXPECT_EQ(encode_fps, stats.encode_frame_rate); 154 EXPECT_EQ(encode_fps, stats.encode_frame_rate);
155 EXPECT_EQ("encoder name", stats.encoder_implementation_name);
154 } 156 }
155 157
156 TEST_F(SendStatisticsProxyTest, Suspended) { 158 TEST_F(SendStatisticsProxyTest, Suspended) {
157 // Verify that the value is false by default. 159 // Verify that the value is false by default.
158 EXPECT_FALSE(statistics_proxy_->GetStats().suspended); 160 EXPECT_FALSE(statistics_proxy_->GetStats().suspended);
159 161
160 // Verify that we can set it to true. 162 // Verify that we can set it to true.
161 statistics_proxy_->OnSuspendChange(true); 163 statistics_proxy_->OnSuspendChange(true);
162 EXPECT_TRUE(statistics_proxy_->GetStats().suspended); 164 EXPECT_TRUE(statistics_proxy_->GetStats().suspended);
163 165
(...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after
748 750
749 EXPECT_EQ(1, test::NumHistogramSamples( 751 EXPECT_EQ(1, test::NumHistogramSamples(
750 "WebRTC.Video.Screenshare.FecBitrateSentInKbps")); 752 "WebRTC.Video.Screenshare.FecBitrateSentInKbps"));
751 EXPECT_EQ(static_cast<int>((rtx_counters.fec.TotalBytes() * 2 * 8) / 753 EXPECT_EQ(static_cast<int>((rtx_counters.fec.TotalBytes() * 2 * 8) /
752 metrics::kMinRunTimeInSeconds / 1000), 754 metrics::kMinRunTimeInSeconds / 1000),
753 test::LastHistogramSample( 755 test::LastHistogramSample(
754 "WebRTC.Video.Screenshare.FecBitrateSentInKbps")); 756 "WebRTC.Video.Screenshare.FecBitrateSentInKbps"));
755 } 757 }
756 758
757 } // namespace webrtc 759 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/video/send_statistics_proxy.cc ('k') | webrtc/video/video_send_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698