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

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

Issue 1751903002: Replace scoped_ptr with unique_ptr in webrtc/video/ (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 9 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.h ('k') | webrtc/video/video_capture_input_unittest.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
11 // This file includes unit tests for SendStatisticsProxy. 11 // This file includes unit tests for SendStatisticsProxy.
12 #include "webrtc/video/send_statistics_proxy.h" 12 #include "webrtc/video/send_statistics_proxy.h"
13 13
14 #include <map> 14 #include <map>
15 #include <memory>
15 #include <string> 16 #include <string>
16 #include <vector> 17 #include <vector>
17 18
18 #include "testing/gtest/include/gtest/gtest.h" 19 #include "testing/gtest/include/gtest/gtest.h"
19 #include "webrtc/system_wrappers/include/metrics.h" 20 #include "webrtc/system_wrappers/include/metrics.h"
20 #include "webrtc/test/histogram.h" 21 #include "webrtc/test/histogram.h"
21 22
22 namespace webrtc { 23 namespace webrtc {
23 24
24 static const uint32_t kFirstSsrc = 17; 25 static const uint32_t kFirstSsrc = 17;
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 88
88 EXPECT_EQ(a.rtcp_stats.fraction_lost, b.rtcp_stats.fraction_lost); 89 EXPECT_EQ(a.rtcp_stats.fraction_lost, b.rtcp_stats.fraction_lost);
89 EXPECT_EQ(a.rtcp_stats.cumulative_lost, b.rtcp_stats.cumulative_lost); 90 EXPECT_EQ(a.rtcp_stats.cumulative_lost, b.rtcp_stats.cumulative_lost);
90 EXPECT_EQ(a.rtcp_stats.extended_max_sequence_number, 91 EXPECT_EQ(a.rtcp_stats.extended_max_sequence_number,
91 b.rtcp_stats.extended_max_sequence_number); 92 b.rtcp_stats.extended_max_sequence_number);
92 EXPECT_EQ(a.rtcp_stats.jitter, b.rtcp_stats.jitter); 93 EXPECT_EQ(a.rtcp_stats.jitter, b.rtcp_stats.jitter);
93 } 94 }
94 } 95 }
95 96
96 SimulatedClock fake_clock_; 97 SimulatedClock fake_clock_;
97 rtc::scoped_ptr<SendStatisticsProxy> statistics_proxy_; 98 std::unique_ptr<SendStatisticsProxy> statistics_proxy_;
98 VideoSendStream::Config config_; 99 VideoSendStream::Config config_;
99 int avg_delay_ms_; 100 int avg_delay_ms_;
100 int max_delay_ms_; 101 int max_delay_ms_;
101 VideoSendStream::Stats expected_; 102 VideoSendStream::Stats expected_;
102 typedef std::map<uint32_t, VideoSendStream::StreamStats>::const_iterator 103 typedef std::map<uint32_t, VideoSendStream::StreamStats>::const_iterator
103 StreamIterator; 104 StreamIterator;
104 }; 105 };
105 106
106 TEST_F(SendStatisticsProxyTest, RtcpStatistics) { 107 TEST_F(SendStatisticsProxyTest, RtcpStatistics) {
107 RtcpStatisticsCallback* callback = statistics_proxy_.get(); 108 RtcpStatisticsCallback* callback = statistics_proxy_.get();
(...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after
652 653
653 EXPECT_EQ(1, test::NumHistogramSamples( 654 EXPECT_EQ(1, test::NumHistogramSamples(
654 "WebRTC.Video.Screenshare.FecBitrateSentInKbps")); 655 "WebRTC.Video.Screenshare.FecBitrateSentInKbps"));
655 EXPECT_EQ(static_cast<int>((rtx_counters.fec.TotalBytes() * 2 * 8) / 656 EXPECT_EQ(static_cast<int>((rtx_counters.fec.TotalBytes() * 2 * 8) /
656 metrics::kMinRunTimeInSeconds / 1000), 657 metrics::kMinRunTimeInSeconds / 1000),
657 test::LastHistogramSample( 658 test::LastHistogramSample(
658 "WebRTC.Video.Screenshare.FecBitrateSentInKbps")); 659 "WebRTC.Video.Screenshare.FecBitrateSentInKbps"));
659 } 660 }
660 661
661 } // namespace webrtc 662 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/video/send_statistics_proxy.h ('k') | webrtc/video/video_capture_input_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698