OLD | NEW |
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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 EXPECT_EQ(rtc::Optional<uint64_t>(), statistics_proxy_->GetStats().qp_sum); | 90 EXPECT_EQ(rtc::Optional<uint64_t>(), statistics_proxy_->GetStats().qp_sum); |
91 statistics_proxy_->OnDecodedFrame(rtc::Optional<uint8_t>(3u), | 91 statistics_proxy_->OnDecodedFrame(rtc::Optional<uint8_t>(3u), |
92 VideoContentType::UNSPECIFIED); | 92 VideoContentType::UNSPECIFIED); |
93 EXPECT_EQ(rtc::Optional<uint64_t>(3u), statistics_proxy_->GetStats().qp_sum); | 93 EXPECT_EQ(rtc::Optional<uint64_t>(3u), statistics_proxy_->GetStats().qp_sum); |
94 statistics_proxy_->OnDecodedFrame(rtc::Optional<uint8_t>(127u), | 94 statistics_proxy_->OnDecodedFrame(rtc::Optional<uint8_t>(127u), |
95 VideoContentType::UNSPECIFIED); | 95 VideoContentType::UNSPECIFIED); |
96 EXPECT_EQ(rtc::Optional<uint64_t>(130u), | 96 EXPECT_EQ(rtc::Optional<uint64_t>(130u), |
97 statistics_proxy_->GetStats().qp_sum); | 97 statistics_proxy_->GetStats().qp_sum); |
98 } | 98 } |
99 | 99 |
| 100 TEST_F(ReceiveStatisticsProxyTest, |
| 101 OnDecodedFrameIncreasesInterframeDelayMsSum) { |
| 102 const uint64_t kInterframeDelayMs1 = 100; |
| 103 const uint64_t kInterframeDelayMs2 = 200; |
| 104 EXPECT_EQ(0u, statistics_proxy_->GetStats().interframe_delay_sum_ms); |
| 105 statistics_proxy_->OnDecodedFrame(rtc::Optional<uint8_t>(3u), |
| 106 VideoContentType::UNSPECIFIED); |
| 107 EXPECT_EQ(0u, statistics_proxy_->GetStats().interframe_delay_sum_ms); |
| 108 |
| 109 fake_clock_.AdvanceTimeMilliseconds(kInterframeDelayMs1); |
| 110 statistics_proxy_->OnDecodedFrame(rtc::Optional<uint8_t>(127u), |
| 111 VideoContentType::UNSPECIFIED); |
| 112 EXPECT_EQ(kInterframeDelayMs1, |
| 113 statistics_proxy_->GetStats().interframe_delay_sum_ms); |
| 114 |
| 115 fake_clock_.AdvanceTimeMilliseconds(kInterframeDelayMs2); |
| 116 statistics_proxy_->OnDecodedFrame(rtc::Optional<uint8_t>(127u), |
| 117 VideoContentType::UNSPECIFIED); |
| 118 EXPECT_EQ(kInterframeDelayMs1 + kInterframeDelayMs2, |
| 119 statistics_proxy_->GetStats().interframe_delay_sum_ms); |
| 120 } |
| 121 |
100 TEST_F(ReceiveStatisticsProxyTest, OnDecodedFrameWithoutQpQpSumWontExist) { | 122 TEST_F(ReceiveStatisticsProxyTest, OnDecodedFrameWithoutQpQpSumWontExist) { |
101 EXPECT_EQ(rtc::Optional<uint64_t>(), statistics_proxy_->GetStats().qp_sum); | 123 EXPECT_EQ(rtc::Optional<uint64_t>(), statistics_proxy_->GetStats().qp_sum); |
102 statistics_proxy_->OnDecodedFrame(rtc::Optional<uint8_t>(), | 124 statistics_proxy_->OnDecodedFrame(rtc::Optional<uint8_t>(), |
103 VideoContentType::UNSPECIFIED); | 125 VideoContentType::UNSPECIFIED); |
104 EXPECT_EQ(rtc::Optional<uint64_t>(), statistics_proxy_->GetStats().qp_sum); | 126 EXPECT_EQ(rtc::Optional<uint64_t>(), statistics_proxy_->GetStats().qp_sum); |
105 } | 127 } |
106 | 128 |
107 TEST_F(ReceiveStatisticsProxyTest, OnDecodedFrameWithoutQpResetsQpSum) { | 129 TEST_F(ReceiveStatisticsProxyTest, OnDecodedFrameWithoutQpResetsQpSum) { |
108 EXPECT_EQ(rtc::Optional<uint64_t>(), statistics_proxy_->GetStats().qp_sum); | 130 EXPECT_EQ(rtc::Optional<uint64_t>(), statistics_proxy_->GetStats().qp_sum); |
109 statistics_proxy_->OnDecodedFrame(rtc::Optional<uint8_t>(3u), | 131 statistics_proxy_->OnDecodedFrame(rtc::Optional<uint8_t>(3u), |
(...skipping 580 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
690 kFirPackets * 60 / metrics::kMinRunTimeInSeconds)); | 712 kFirPackets * 60 / metrics::kMinRunTimeInSeconds)); |
691 EXPECT_EQ( | 713 EXPECT_EQ( |
692 1, metrics::NumEvents("WebRTC.Video.PliPacketsSentPerMinute", | 714 1, metrics::NumEvents("WebRTC.Video.PliPacketsSentPerMinute", |
693 kPliPackets * 60 / metrics::kMinRunTimeInSeconds)); | 715 kPliPackets * 60 / metrics::kMinRunTimeInSeconds)); |
694 EXPECT_EQ( | 716 EXPECT_EQ( |
695 1, metrics::NumEvents("WebRTC.Video.NackPacketsSentPerMinute", | 717 1, metrics::NumEvents("WebRTC.Video.NackPacketsSentPerMinute", |
696 kNackPackets * 60 / metrics::kMinRunTimeInSeconds)); | 718 kNackPackets * 60 / metrics::kMinRunTimeInSeconds)); |
697 } | 719 } |
698 | 720 |
699 } // namespace webrtc | 721 } // namespace webrtc |
OLD | NEW |