Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(157)

Side by Side Diff: webrtc/modules/pacing/paced_sender_unittest.cc

Issue 2746153002: Return a long timeout value from TimeUntilNextProcess when the PacedSender is paused (Closed)
Patch Set: Update BUILD.gn Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 616 matching lines...) Expand 10 before | Expand all | Expand 10 after
627 sequence_number++, second_capture_time_ms, 250, 627 sequence_number++, second_capture_time_ms, 250,
628 false); 628 false);
629 } 629 }
630 630
631 // Expect everything to be queued. 631 // Expect everything to be queued.
632 EXPECT_EQ(second_capture_time_ms - capture_time_ms, 632 EXPECT_EQ(second_capture_time_ms - capture_time_ms,
633 send_bucket_->QueueInMs()); 633 send_bucket_->QueueInMs());
634 634
635 for (int i = 0; i < 10; ++i) { 635 for (int i = 0; i < 10; ++i) {
636 clock_.AdvanceTimeMilliseconds(5); 636 clock_.AdvanceTimeMilliseconds(5);
637 EXPECT_EQ(0, send_bucket_->TimeUntilNextProcess()); 637 // TimeUntilNextProcess must not return 0 when paused. If it does,
638 // we risk running a busy loop, so ideally it should return a large value.
639 EXPECT_LT(1000, send_bucket_->TimeUntilNextProcess());
stefan-webrtc 2017/03/15 12:43:18 EXPECT_GT(..., 1000), please... I can't read this.
tommi 2017/03/15 13:42:56 haha, yeah, it looks pretty terrible :) In genera
638 send_bucket_->Process(); 640 send_bucket_->Process();
639 } 641 }
640 642
641 // Expect high prio packets to come out first followed by normal 643 // Expect high prio packets to come out first followed by normal
642 // prio packets and low prio packets (all in capture order). 644 // prio packets and low prio packets (all in capture order).
643 { 645 {
644 ::testing::InSequence sequence; 646 ::testing::InSequence sequence;
645 EXPECT_CALL(callback_, 647 EXPECT_CALL(callback_,
646 TimeToSendPacket(ssrc_high_priority, _, capture_time_ms, _, _)) 648 TimeToSendPacket(ssrc_high_priority, _, capture_time_ms, _, _))
647 .Times(packets_to_send_per_interval) 649 .Times(packets_to_send_per_interval)
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after
1068 .WillRepeatedly(Return(0)); 1070 .WillRepeatedly(Return(0));
1069 send_bucket_->Process(); 1071 send_bucket_->Process();
1070 EXPECT_EQ(1, send_bucket_->TimeUntilNextProcess()); 1072 EXPECT_EQ(1, send_bucket_->TimeUntilNextProcess());
1071 clock_.AdvanceTimeMilliseconds(1); 1073 clock_.AdvanceTimeMilliseconds(1);
1072 send_bucket_->Process(); 1074 send_bucket_->Process();
1073 EXPECT_EQ(5, send_bucket_->TimeUntilNextProcess()); 1075 EXPECT_EQ(5, send_bucket_->TimeUntilNextProcess());
1074 } 1076 }
1075 1077
1076 } // namespace test 1078 } // namespace test
1077 } // namespace webrtc 1079 } // namespace webrtc
OLDNEW
« webrtc/modules/pacing/paced_sender.cc ('K') | « webrtc/modules/pacing/paced_sender.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698