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

Unified Diff: webrtc/video/send_statistics_proxy_unittest.cc

Issue 2061423003: Refactor NACK bitrate allocation (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Fixed nit Created 4 years, 5 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/video/send_statistics_proxy_unittest.cc
diff --git a/webrtc/video/send_statistics_proxy_unittest.cc b/webrtc/video/send_statistics_proxy_unittest.cc
index 2bf038d2c437ce11a6d90a427ae274a0a4533f2a..ad51f2abe69111a875f9a91d3c8f7214d418f101 100644
--- a/webrtc/video/send_statistics_proxy_unittest.cc
+++ b/webrtc/video/send_statistics_proxy_unittest.cc
@@ -226,24 +226,24 @@ TEST_F(SendStatisticsProxyTest, DataCounters) {
TEST_F(SendStatisticsProxyTest, Bitrate) {
BitrateStatisticsObserver* observer = statistics_proxy_.get();
for (const auto& ssrc : config_.rtp.ssrcs) {
- BitrateStatistics total;
- BitrateStatistics retransmit;
+ uint32_t total;
+ uint32_t retransmit;
// Use ssrc as bitrate_bps to get a unique value for each stream.
- total.bitrate_bps = ssrc;
- retransmit.bitrate_bps = ssrc + 1;
+ total = ssrc;
+ retransmit = ssrc + 1;
observer->Notify(total, retransmit, ssrc);
- expected_.substreams[ssrc].total_bitrate_bps = total.bitrate_bps;
- expected_.substreams[ssrc].retransmit_bitrate_bps = retransmit.bitrate_bps;
+ expected_.substreams[ssrc].total_bitrate_bps = total;
+ expected_.substreams[ssrc].retransmit_bitrate_bps = retransmit;
}
for (const auto& ssrc : config_.rtp.rtx.ssrcs) {
- BitrateStatistics total;
- BitrateStatistics retransmit;
+ uint32_t total;
+ uint32_t retransmit;
// Use ssrc as bitrate_bps to get a unique value for each stream.
- total.bitrate_bps = ssrc;
- retransmit.bitrate_bps = ssrc + 1;
+ total = ssrc;
+ retransmit = ssrc + 1;
observer->Notify(total, retransmit, ssrc);
- expected_.substreams[ssrc].total_bitrate_bps = total.bitrate_bps;
- expected_.substreams[ssrc].retransmit_bitrate_bps = retransmit.bitrate_bps;
+ expected_.substreams[ssrc].total_bitrate_bps = total;
+ expected_.substreams[ssrc].retransmit_bitrate_bps = retransmit;
}
VideoSendStream::Stats stats = statistics_proxy_->GetStats();
@@ -397,8 +397,8 @@ TEST_F(SendStatisticsProxyTest, NoSubstreams) {
rtcp_callback->StatisticsUpdated(rtcp_stats, excluded_ssrc);
// From BitrateStatisticsObserver.
- BitrateStatistics total;
- BitrateStatistics retransmit;
+ uint32_t total = 0;
+ uint32_t retransmit = 0;
BitrateStatisticsObserver* bitrate_observer = statistics_proxy_.get();
bitrate_observer->Notify(total, retransmit, excluded_ssrc);
@@ -484,8 +484,7 @@ TEST_F(SendStatisticsProxyTest, ClearsResolutionFromInactiveSsrcs) {
}
TEST_F(SendStatisticsProxyTest, ClearsBitratesFromInactiveSsrcs) {
- BitrateStatistics bitrate;
- bitrate.bitrate_bps = 42;
+ uint32_t bitrate = 42;
BitrateStatisticsObserver* observer = statistics_proxy_.get();
observer->Notify(bitrate, bitrate, config_.rtp.ssrcs[0]);
observer->Notify(bitrate, bitrate, config_.rtp.ssrcs[1]);
@@ -493,9 +492,9 @@ TEST_F(SendStatisticsProxyTest, ClearsBitratesFromInactiveSsrcs) {
statistics_proxy_->OnInactiveSsrc(config_.rtp.ssrcs[1]);
VideoSendStream::Stats stats = statistics_proxy_->GetStats();
- EXPECT_EQ(static_cast<int>(bitrate.bitrate_bps),
+ EXPECT_EQ(static_cast<int>(bitrate),
stats.substreams[config_.rtp.ssrcs[0]].total_bitrate_bps);
- EXPECT_EQ(static_cast<int>(bitrate.bitrate_bps),
+ EXPECT_EQ(static_cast<int>(bitrate),
stats.substreams[config_.rtp.ssrcs[0]].retransmit_bitrate_bps);
EXPECT_EQ(0, stats.substreams[config_.rtp.ssrcs[1]].total_bitrate_bps);
EXPECT_EQ(0, stats.substreams[config_.rtp.ssrcs[1]].retransmit_bitrate_bps);
« 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