OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 1028 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1039 const int kNotAProbe = PacedPacketInfo::kNotAProbe; | 1039 const int kNotAProbe = PacedPacketInfo::kNotAProbe; |
1040 // No more probing packets. | 1040 // No more probing packets. |
1041 EXPECT_CALL(callback_, | 1041 EXPECT_CALL(callback_, |
1042 TimeToSendPadding( | 1042 TimeToSendPadding( |
1043 _, Field(&PacedPacketInfo::probe_cluster_id, kNotAProbe))) | 1043 _, Field(&PacedPacketInfo::probe_cluster_id, kNotAProbe))) |
1044 .Times(1) | 1044 .Times(1) |
1045 .WillRepeatedly(Return(500)); | 1045 .WillRepeatedly(Return(500)); |
1046 send_bucket_->Process(); | 1046 send_bucket_->Process(); |
1047 } | 1047 } |
1048 | 1048 |
| 1049 TEST_F(PacedSenderTest, AvoidBusyLoopOnSendFailure) { |
| 1050 uint32_t ssrc = 12346; |
| 1051 uint16_t sequence_number = 1234; |
| 1052 const size_t kPacketSize = kFirstClusterBps / (8000 / 10); |
| 1053 |
| 1054 send_bucket_->SetSendBitrateLimits(kTargetBitrateBps, kTargetBitrateBps); |
| 1055 send_bucket_->SetProbingEnabled(true); |
| 1056 send_bucket_->InsertPacket(PacedSender::kNormalPriority, ssrc, |
| 1057 sequence_number, clock_.TimeInMilliseconds(), |
| 1058 kPacketSize, false); |
| 1059 |
| 1060 EXPECT_CALL(callback_, TimeToSendPacket(_, _, _, _, _)) |
| 1061 .WillOnce(Return(true)); |
| 1062 send_bucket_->Process(); |
| 1063 EXPECT_EQ(10, send_bucket_->TimeUntilNextProcess()); |
| 1064 clock_.AdvanceTimeMilliseconds(9); |
| 1065 |
| 1066 EXPECT_CALL(callback_, TimeToSendPadding(_, _)) |
| 1067 .Times(2) |
| 1068 .WillRepeatedly(Return(0)); |
| 1069 send_bucket_->Process(); |
| 1070 EXPECT_EQ(1, send_bucket_->TimeUntilNextProcess()); |
| 1071 clock_.AdvanceTimeMilliseconds(1); |
| 1072 send_bucket_->Process(); |
| 1073 EXPECT_EQ(5, send_bucket_->TimeUntilNextProcess()); |
| 1074 } |
| 1075 |
1049 } // namespace test | 1076 } // namespace test |
1050 } // namespace webrtc | 1077 } // namespace webrtc |
OLD | NEW |