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); | |
sprang_webrtc
2017/07/06 09:16:28
nit: indentation
ilnik
2017/07/06 09:28:58
Done.
| |
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 538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
648 kFirPackets * 60 / metrics::kMinRunTimeInSeconds)); | 670 kFirPackets * 60 / metrics::kMinRunTimeInSeconds)); |
649 EXPECT_EQ( | 671 EXPECT_EQ( |
650 1, metrics::NumEvents("WebRTC.Video.PliPacketsSentPerMinute", | 672 1, metrics::NumEvents("WebRTC.Video.PliPacketsSentPerMinute", |
651 kPliPackets * 60 / metrics::kMinRunTimeInSeconds)); | 673 kPliPackets * 60 / metrics::kMinRunTimeInSeconds)); |
652 EXPECT_EQ( | 674 EXPECT_EQ( |
653 1, metrics::NumEvents("WebRTC.Video.NackPacketsSentPerMinute", | 675 1, metrics::NumEvents("WebRTC.Video.NackPacketsSentPerMinute", |
654 kNackPackets * 60 / metrics::kMinRunTimeInSeconds)); | 676 kNackPackets * 60 / metrics::kMinRunTimeInSeconds)); |
655 } | 677 } |
656 | 678 |
657 } // namespace webrtc | 679 } // namespace webrtc |
OLD | NEW |