OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 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 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 EXPECT_EQ(expected_bps, filter_.bits_per_second()); | 201 EXPECT_EQ(expected_bps, filter_.bits_per_second()); |
202 | 202 |
203 for (auto* packet : packets) | 203 for (auto* packet : packets) |
204 delete packet; | 204 delete packet; |
205 } | 205 } |
206 | 206 |
207 private: | 207 private: |
208 RateCounterFilter filter_; | 208 RateCounterFilter filter_; |
209 int64_t now_ms_; | 209 int64_t now_ms_; |
210 | 210 |
211 DISALLOW_COPY_AND_ASSIGN(BweTestFramework_RateCounterFilterTest); | 211 RTC_DISALLOW_COPY_AND_ASSIGN(BweTestFramework_RateCounterFilterTest); |
212 }; | 212 }; |
213 | 213 |
214 TEST_F(BweTestFramework_RateCounterFilterTest, Short) { | 214 TEST_F(BweTestFramework_RateCounterFilterTest, Short) { |
215 // 100ms, 100 bytes per packet, should result in 10 pps and 8 kbps. We're | 215 // 100ms, 100 bytes per packet, should result in 10 pps and 8 kbps. We're |
216 // generating one packet every 10 ms ; 10 * 800 = 8k | 216 // generating one packet every 10 ms ; 10 * 800 = 8k |
217 TestRateCounter(100, 800, 10, 8000); | 217 TestRateCounter(100, 800, 10, 8000); |
218 } | 218 } |
219 | 219 |
220 TEST_F(BweTestFramework_RateCounterFilterTest, Medium) { | 220 TEST_F(BweTestFramework_RateCounterFilterTest, Medium) { |
221 // 100ms, like above. | 221 // 100ms, like above. |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
375 ASSERT_TRUE(IsSequenceNumberSorted(accumulated_packets_)); | 375 ASSERT_TRUE(IsSequenceNumberSorted(accumulated_packets_)); |
376 } | 376 } |
377 | 377 |
378 DelayFilter filter_; | 378 DelayFilter filter_; |
379 Packets accumulated_packets_; | 379 Packets accumulated_packets_; |
380 | 380 |
381 private: | 381 private: |
382 int64_t now_ms_; | 382 int64_t now_ms_; |
383 uint16_t sequence_number_; | 383 uint16_t sequence_number_; |
384 | 384 |
385 DISALLOW_COPY_AND_ASSIGN(BweTestFramework_DelayFilterTest); | 385 RTC_DISALLOW_COPY_AND_ASSIGN(BweTestFramework_DelayFilterTest); |
386 }; | 386 }; |
387 | 387 |
388 TEST_F(BweTestFramework_DelayFilterTest, Delay0) { | 388 TEST_F(BweTestFramework_DelayFilterTest, Delay0) { |
389 TestDelayFilter(1, 0, 0); // No input should yield no output | 389 TestDelayFilter(1, 0, 0); // No input should yield no output |
390 TestDelayFilter(1, 10, 10); // Expect no delay (delay time is zero) | 390 TestDelayFilter(1, 10, 10); // Expect no delay (delay time is zero) |
391 TestDelayFilter(1, 0, 0); // Check no packets are still in buffer | 391 TestDelayFilter(1, 0, 0); // Check no packets are still in buffer |
392 filter_.SetOneWayDelayMs(0); | 392 filter_.SetOneWayDelayMs(0); |
393 TestDelayFilter(1, 5, 5); // Expect no delay (delay time is zero) | 393 TestDelayFilter(1, 5, 5); // Expect no delay (delay time is zero) |
394 TestDelayFilter(1, 0, 0); // Check no packets are still in buffer | 394 TestDelayFilter(1, 0, 0); // Check no packets are still in buffer |
395 } | 395 } |
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
660 EXPECT_GE(max_delay_ms * 1000, delay_us); | 660 EXPECT_GE(max_delay_ms * 1000, delay_us); |
661 } | 661 } |
662 } | 662 } |
663 | 663 |
664 private: | 664 private: |
665 int64_t now_ms_; | 665 int64_t now_ms_; |
666 uint16_t sequence_number_; | 666 uint16_t sequence_number_; |
667 Packets output_packets_; | 667 Packets output_packets_; |
668 std::vector<int64_t> send_times_us_; | 668 std::vector<int64_t> send_times_us_; |
669 | 669 |
670 DISALLOW_COPY_AND_ASSIGN(BweTestFramework_ChokeFilterTest); | 670 RTC_DISALLOW_COPY_AND_ASSIGN(BweTestFramework_ChokeFilterTest); |
671 }; | 671 }; |
672 | 672 |
673 TEST_F(BweTestFramework_ChokeFilterTest, NoQueue) { | 673 TEST_F(BweTestFramework_ChokeFilterTest, NoQueue) { |
674 const int kCapacityKbps = 10; | 674 const int kCapacityKbps = 10; |
675 const size_t kPacketSizeBytes = 125; | 675 const size_t kPacketSizeBytes = 125; |
676 const int64_t kExpectedSendTimeUs = | 676 const int64_t kExpectedSendTimeUs = |
677 (kPacketSizeBytes * 8 * 1000 + kCapacityKbps / 2) / kCapacityKbps; | 677 (kPacketSizeBytes * 8 * 1000 + kCapacityKbps / 2) / kCapacityKbps; |
678 uint16_t sequence_number = 0; | 678 uint16_t sequence_number = 0; |
679 int64_t send_time_us = 0; | 679 int64_t send_time_us = 0; |
680 ChokeFilter filter(NULL, 0); | 680 ChokeFilter filter(NULL, 0); |
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1042 packets.push_back(feedback); | 1042 packets.push_back(feedback); |
1043 sender.RunFor(10000, &packets); | 1043 sender.RunFor(10000, &packets); |
1044 EXPECT_EQ(820000u, source.bits_per_second()); | 1044 EXPECT_EQ(820000u, source.bits_per_second()); |
1045 | 1045 |
1046 for (auto* packet : packets) | 1046 for (auto* packet : packets) |
1047 delete packet; | 1047 delete packet; |
1048 } | 1048 } |
1049 } // namespace bwe | 1049 } // namespace bwe |
1050 } // namespace testing | 1050 } // namespace testing |
1051 } // namespace webrtc | 1051 } // namespace webrtc |
OLD | NEW |