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

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

Issue 2033073002: BitrateProber now correctly change state to kWait when the last probing (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 6 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 852 matching lines...) Expand 10 before | Expand all | Expand 10 after
863 .Times(1) 863 .Times(1)
864 .WillRepeatedly(Return(true)); 864 .WillRepeatedly(Return(true));
865 for (int i = 0; i < 3; ++i) { 865 for (int i = 0; i < 3; ++i) {
866 clock_.AdvanceTimeMilliseconds(30); // Max delta. 866 clock_.AdvanceTimeMilliseconds(30); // Max delta.
867 send_bucket_->Process(); 867 send_bucket_->Process();
868 } 868 }
869 869
870 EXPECT_EQ(0, send_bucket_->AverageQueueTimeMs()); 870 EXPECT_EQ(0, send_bucket_->AverageQueueTimeMs());
871 } 871 }
872 872
873 TEST_F(PacedSenderTest, DISABLED_ProbeClusterId) { 873 TEST_F(PacedSenderTest, ProbeClusterId) {
874 uint32_t ssrc = 12346; 874 uint32_t ssrc = 12346;
875 uint16_t sequence_number = 1234; 875 uint16_t sequence_number = 1234;
876 const size_t kPacketSize = 1200; 876 const size_t kPacketSize = 1200;
877 877
danilchap 2016/06/02 14:28:05 May be add constants kPacketsPerProbe = 5; kPacket
878 send_bucket_->SetAllocatedSendBitrate(kTargetBitrateBps, kTargetBitrateBps);
878 send_bucket_->SetProbingEnabled(true); 879 send_bucket_->SetProbingEnabled(true);
879 for (int i = 0; i < 11; ++i) { 880 for (int i = 0; i < 11; ++i) {
880 send_bucket_->InsertPacket(PacedSender::kNormalPriority, ssrc, 881 send_bucket_->InsertPacket(PacedSender::kNormalPriority, ssrc,
881 sequence_number + i, clock_.TimeInMilliseconds(), 882 sequence_number + i, clock_.TimeInMilliseconds(),
882 kPacketSize, false); 883 kPacketSize, false);
883 } 884 }
884 885
885 // First probing cluster. 886 // First probing cluster.
886 EXPECT_CALL(callback_, TimeToSendPacket(_, _, _, _, 0)) 887 EXPECT_CALL(callback_, TimeToSendPacket(_, _, _, _, 0))
887 .Times(6) 888 .Times(6)
888 .WillRepeatedly(Return(true)); 889 .WillRepeatedly(Return(true));
889 for (int i = 0; i < 6; ++i) 890 for (int i = 0; i < 6; ++i) {
891 clock_.AdvanceTimeMilliseconds(20);
890 send_bucket_->Process(); 892 send_bucket_->Process();
893 }
891 894
892 // Second probing cluster. 895 // Second probing cluster.
893 EXPECT_CALL(callback_, TimeToSendPacket(_, _, _, _, 1)) 896 EXPECT_CALL(callback_, TimeToSendPacket(_, _, _, _, 1))
894 .Times(5) 897 .Times(5)
895 .WillRepeatedly(Return(true)); 898 .WillRepeatedly(Return(true));
896 for (int i = 0; i < 5; ++i) 899 for (int i = 0; i < 5; ++i) {
900 clock_.AdvanceTimeMilliseconds(20);
897 send_bucket_->Process(); 901 send_bucket_->Process();
902 }
898 903
899 // No more probing packets. 904 // No more probing packets.
900 EXPECT_CALL(callback_, TimeToSendPadding(_, _)).Times(1); 905 EXPECT_CALL(callback_, TimeToSendPadding(_, PacketInfo::kNotAProbe))
906 .Times(1)
907 .WillRepeatedly(Return(500));
901 send_bucket_->Process(); 908 send_bucket_->Process();
902 } 909 }
903 910
904 } // namespace test 911 } // namespace test
905 } // namespace webrtc 912 } // namespace webrtc
OLDNEW
« webrtc/modules/pacing/bitrate_prober.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