OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2014 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 #include "webrtc/test/gtest.h" | 11 #include "webrtc/test/gtest.h" |
12 | |
13 #include "webrtc/video/report_block_stats.h" | 12 #include "webrtc/video/report_block_stats.h" |
14 | 13 |
15 namespace webrtc { | 14 namespace webrtc { |
16 | 15 |
17 class ReportBlockStatsTest : public ::testing::Test { | 16 class ReportBlockStatsTest : public ::testing::Test { |
18 protected: | 17 protected: |
19 ReportBlockStatsTest() : kSsrc1(0x12345), kSsrc2(0x23456) {} | 18 ReportBlockStatsTest() : kSsrc1(0x12345), kSsrc2(0x23456) {} |
20 | 19 |
21 void SetUp() override { | 20 void SetUp() override { |
22 // kSsrc1: block 1-3. | 21 // kSsrc1: block 1-3. |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 // fl: 100 * (15-10) / (24100-24000) = 5% | 136 // fl: 100 * (15-10) / (24100-24000) = 5% |
138 stats.Store(RtcpReportBlockToRtcpStatistics(block1_2_), kRemoteSsrc, kSsrc1); | 137 stats.Store(RtcpReportBlockToRtcpStatistics(block1_2_), kRemoteSsrc, kSsrc1); |
139 EXPECT_EQ(5, stats.FractionLostInPercent()); | 138 EXPECT_EQ(5, stats.FractionLostInPercent()); |
140 // fl: 100 * (50-10) / (24200-24000) = 20% | 139 // fl: 100 * (50-10) / (24200-24000) = 20% |
141 stats.Store(RtcpReportBlockToRtcpStatistics(block1_3_), kRemoteSsrc, kSsrc1); | 140 stats.Store(RtcpReportBlockToRtcpStatistics(block1_3_), kRemoteSsrc, kSsrc1); |
142 EXPECT_EQ(20, stats.FractionLostInPercent()); | 141 EXPECT_EQ(20, stats.FractionLostInPercent()); |
143 } | 142 } |
144 | 143 |
145 } // namespace webrtc | 144 } // namespace webrtc |
146 | 145 |
OLD | NEW |