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