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

Side by Side Diff: webrtc/modules/congestion_controller/delay_based_bwe_unittest_helper.cc

Issue 2235373004: Probing: Add support for exponential startup probing (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@fix_probing2
Patch Set: Updates Created 4 years, 4 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) 2016 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2016 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 #include "webrtc/modules/congestion_controller/delay_based_bwe_unittest_helper.h " 10 #include "webrtc/modules/congestion_controller/delay_based_bwe_unittest_helper.h "
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 std::max(time_now_us + required_network_time_us, 141 std::max(time_now_us + required_network_time_us,
142 prev_arrival_time_us_ + required_network_time_us); 142 prev_arrival_time_us_ + required_network_time_us);
143 packet.arrival_time_ms = prev_arrival_time_us_ / 1000; 143 packet.arrival_time_ms = prev_arrival_time_us_ / 1000;
144 ++i; 144 ++i;
145 } 145 }
146 it = std::min_element(streams_.begin(), streams_.end(), RtpStream::Compare); 146 it = std::min_element(streams_.begin(), streams_.end(), RtpStream::Compare);
147 return std::max((*it)->next_rtp_time(), time_now_us); 147 return std::max((*it)->next_rtp_time(), time_now_us);
148 } 148 }
149 } // namespace test 149 } // namespace test
150 150
151 // TODO(isheriff): Tests need fixes before submit.
151 DelayBasedBweTest::DelayBasedBweTest() 152 DelayBasedBweTest::DelayBasedBweTest()
152 : clock_(100000000), 153 : clock_(100000000),
153 bitrate_observer_(new test::TestBitrateObserver), 154 bitrate_observer_(new test::TestBitrateObserver),
154 bitrate_estimator_(new DelayBasedBwe(bitrate_observer_.get(), &clock_)), 155 bitrate_estimator_(new DelayBasedBwe(nullptr, &clock_)),
155 stream_generator_( 156 stream_generator_(new test::StreamGenerator(1e6, // Capacity.
156 new test::StreamGenerator(1e6, // Capacity. 157 clock_.TimeInMicroseconds())),
157 clock_.TimeInMicroseconds())),
158 arrival_time_offset_ms_(0) {} 158 arrival_time_offset_ms_(0) {}
159 159
160 DelayBasedBweTest::~DelayBasedBweTest() {} 160 DelayBasedBweTest::~DelayBasedBweTest() {}
161 161
162 void DelayBasedBweTest::AddDefaultStream() { 162 void DelayBasedBweTest::AddDefaultStream() {
163 stream_generator_->AddStream(new test::RtpStream(30, 3e5)); 163 stream_generator_->AddStream(new test::RtpStream(30, 3e5));
164 } 164 }
165 165
166 const uint32_t DelayBasedBweTest::kDefaultSsrc = 0; 166 const uint32_t DelayBasedBweTest::kDefaultSsrc = 0;
167 167
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after
495 sequence_number++, 1000); 495 sequence_number++, 1000);
496 clock_.AdvanceTimeMilliseconds(2 * kFrameIntervalMs); 496 clock_.AdvanceTimeMilliseconds(2 * kFrameIntervalMs);
497 send_time_ms += kFrameIntervalMs; 497 send_time_ms += kFrameIntervalMs;
498 bitrate_estimator_->Process(); 498 bitrate_estimator_->Process();
499 } 499 }
500 uint32_t bitrate_after = 0; 500 uint32_t bitrate_after = 0;
501 bitrate_estimator_->LatestEstimate(&ssrcs, &bitrate_after); 501 bitrate_estimator_->LatestEstimate(&ssrcs, &bitrate_after);
502 EXPECT_LT(bitrate_after, bitrate_before); 502 EXPECT_LT(bitrate_after, bitrate_before);
503 } 503 }
504 } // namespace webrtc 504 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698