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

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

Issue 2253563002: Add codec name to CodecSpecificInfo and get the codec name stats from there instead. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Fix fake_encoder.cc Created 4 years, 4 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_encoder.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_->OnEncoderStatsUpdate(encode_fps, media_bitrate_bps, 149 statistics_proxy_->OnEncoderStatsUpdate(encode_fps, media_bitrate_bps);
150 "encoder name");
151 150
152 VideoSendStream::Stats stats = statistics_proxy_->GetStats(); 151 VideoSendStream::Stats stats = statistics_proxy_->GetStats();
153 EXPECT_EQ(media_bitrate_bps, stats.media_bitrate_bps); 152 EXPECT_EQ(media_bitrate_bps, stats.media_bitrate_bps);
154 EXPECT_EQ(encode_fps, stats.encode_frame_rate); 153 EXPECT_EQ(encode_fps, stats.encode_frame_rate);
155 EXPECT_EQ("encoder name", stats.encoder_implementation_name);
156 } 154 }
157 155
158 TEST_F(SendStatisticsProxyTest, Suspended) { 156 TEST_F(SendStatisticsProxyTest, Suspended) {
159 // Verify that the value is false by default. 157 // Verify that the value is false by default.
160 EXPECT_FALSE(statistics_proxy_->GetStats().suspended); 158 EXPECT_FALSE(statistics_proxy_->GetStats().suspended);
161 159
162 // Verify that we can set it to true. 160 // Verify that we can set it to true.
163 statistics_proxy_->OnSuspendChange(true); 161 statistics_proxy_->OnSuspendChange(true);
164 EXPECT_TRUE(statistics_proxy_->GetStats().suspended); 162 EXPECT_TRUE(statistics_proxy_->GetStats().suspended);
165 163
(...skipping 574 matching lines...) Expand 10 before | Expand all | Expand 10 after
740 738
741 EXPECT_EQ( 739 EXPECT_EQ(
742 1, metrics::NumSamples("WebRTC.Video.Screenshare.FecBitrateSentInKbps")); 740 1, metrics::NumSamples("WebRTC.Video.Screenshare.FecBitrateSentInKbps"));
743 EXPECT_EQ(1, metrics::NumEvents( 741 EXPECT_EQ(1, metrics::NumEvents(
744 "WebRTC.Video.Screenshare.FecBitrateSentInKbps", 742 "WebRTC.Video.Screenshare.FecBitrateSentInKbps",
745 static_cast<int>((rtx_counters.fec.TotalBytes() * 2 * 8) / 743 static_cast<int>((rtx_counters.fec.TotalBytes() * 2 * 8) /
746 metrics::kMinRunTimeInSeconds / 1000))); 744 metrics::kMinRunTimeInSeconds / 1000)));
747 } 745 }
748 746
749 } // namespace webrtc 747 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/video/send_statistics_proxy.cc ('k') | webrtc/video/video_encoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698