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

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

Issue 3009793002: Implement googContentType GetStats metric reported on receive side. (Closed)
Patch Set: Fix ce Created 3 years, 3 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
OLDNEW
1 /* 1 /*
2 * Copyright 2016 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2016 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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 EXPECT_EQ(rtc::Optional<uint64_t>(), statistics_proxy_->GetStats().qp_sum); 91 EXPECT_EQ(rtc::Optional<uint64_t>(), statistics_proxy_->GetStats().qp_sum);
92 statistics_proxy_->OnDecodedFrame(rtc::Optional<uint8_t>(3u), 92 statistics_proxy_->OnDecodedFrame(rtc::Optional<uint8_t>(3u),
93 VideoContentType::UNSPECIFIED); 93 VideoContentType::UNSPECIFIED);
94 EXPECT_EQ(rtc::Optional<uint64_t>(3u), statistics_proxy_->GetStats().qp_sum); 94 EXPECT_EQ(rtc::Optional<uint64_t>(3u), statistics_proxy_->GetStats().qp_sum);
95 statistics_proxy_->OnDecodedFrame(rtc::Optional<uint8_t>(127u), 95 statistics_proxy_->OnDecodedFrame(rtc::Optional<uint8_t>(127u),
96 VideoContentType::UNSPECIFIED); 96 VideoContentType::UNSPECIFIED);
97 EXPECT_EQ(rtc::Optional<uint64_t>(130u), 97 EXPECT_EQ(rtc::Optional<uint64_t>(130u),
98 statistics_proxy_->GetStats().qp_sum); 98 statistics_proxy_->GetStats().qp_sum);
99 } 99 }
100 100
101 TEST_F(ReceiveStatisticsProxyTest, ReportsContentType) {
102 EXPECT_EQ("realtime", statistics_proxy_->GetStats().content_type);
103 statistics_proxy_->OnDecodedFrame(rtc::Optional<uint8_t>(3u),
104 VideoContentType::SCREENSHARE);
tommi 2017/08/30 15:03:28 indentation seems off. can you run git cl format?
ilnik 2017/08/30 15:30:24 Done.
105 EXPECT_EQ("screen", statistics_proxy_->GetStats().content_type);
106 statistics_proxy_->OnDecodedFrame(rtc::Optional<uint8_t>(3u),
107 VideoContentType::UNSPECIFIED);
108 EXPECT_EQ("realtime", statistics_proxy_->GetStats().content_type);
109 }
110
101 TEST_F(ReceiveStatisticsProxyTest, ReportsMaxInterframeDelay) { 111 TEST_F(ReceiveStatisticsProxyTest, ReportsMaxInterframeDelay) {
102 const int64_t kInterframeDelayMs1 = 100; 112 const int64_t kInterframeDelayMs1 = 100;
103 const int64_t kInterframeDelayMs2 = 200; 113 const int64_t kInterframeDelayMs2 = 200;
104 const int64_t kInterframeDelayMs3 = 100; 114 const int64_t kInterframeDelayMs3 = 100;
105 EXPECT_EQ(-1, statistics_proxy_->GetStats().interframe_delay_max_ms); 115 EXPECT_EQ(-1, statistics_proxy_->GetStats().interframe_delay_max_ms);
106 statistics_proxy_->OnDecodedFrame(rtc::Optional<uint8_t>(3u), 116 statistics_proxy_->OnDecodedFrame(rtc::Optional<uint8_t>(3u),
107 VideoContentType::UNSPECIFIED); 117 VideoContentType::UNSPECIFIED);
108 EXPECT_EQ(-1, statistics_proxy_->GetStats().interframe_delay_max_ms); 118 EXPECT_EQ(-1, statistics_proxy_->GetStats().interframe_delay_max_ms);
109 119
110 fake_clock_.AdvanceTimeMilliseconds(kInterframeDelayMs1); 120 fake_clock_.AdvanceTimeMilliseconds(kInterframeDelayMs1);
(...skipping 833 matching lines...) Expand 10 before | Expand all | Expand 10 after
944 metrics::MinSample("WebRTC.Video.InterframeDelayInMs")); 954 metrics::MinSample("WebRTC.Video.InterframeDelayInMs"));
945 EXPECT_EQ(kInterFrameDelayMs2, 955 EXPECT_EQ(kInterFrameDelayMs2,
946 metrics::MinSample("WebRTC.Video.InterframeDelayMaxInMs")); 956 metrics::MinSample("WebRTC.Video.InterframeDelayMaxInMs"));
947 EXPECT_EQ((kInterFrameDelayMs1 + kInterFrameDelayMs2) / 2, 957 EXPECT_EQ((kInterFrameDelayMs1 + kInterFrameDelayMs2) / 2,
948 metrics::MinSample( 958 metrics::MinSample(
949 "WebRTC.Video.InterframeDelayInMs.ExperimentGroup0")); 959 "WebRTC.Video.InterframeDelayInMs.ExperimentGroup0"));
950 } 960 }
951 } 961 }
952 962
953 } // namespace webrtc 963 } // namespace webrtc
OLDNEW
« webrtc/video/receive_statistics_proxy.cc ('K') | « webrtc/video/receive_statistics_proxy.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698