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

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

Issue 2512693002: Implement Theil-Sen's method for fitting a line to noisy data (used in bandwidth estimation). (Closed)
Patch Set: Review comments Created 4 years 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 10
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 // Simulate a client leaving and rejoining the call after some multiple of 159 // Simulate a client leaving and rejoining the call after some multiple of
160 // 64 seconds later. This will cause a zero difference in abs send times due 160 // 64 seconds later. This will cause a zero difference in abs send times due
161 // to the wrap, but a big difference in arrival time, if streams aren't 161 // to the wrap, but a big difference in arrival time, if streams aren't
162 // properly timed out. 162 // properly timed out.
163 TestWrappingHelper(10 * 64); 163 TestWrappingHelper(10 * 64);
164 } 164 }
165 165
166 class DelayBasedBweExperimentTest : public DelayBasedBweTest { 166 class DelayBasedBweExperimentTest : public DelayBasedBweTest {
167 public: 167 public:
168 DelayBasedBweExperimentTest() 168 DelayBasedBweExperimentTest()
169 : override_field_trials_("WebRTC-ImprovedBitrateEstimate/Enabled/") {} 169 : override_field_trials_("WebRTC-ImprovedBitrateEstimate/Enabled/") {
170
171 protected:
172 void SetUp() override {
173 bitrate_estimator_.reset(new DelayBasedBwe(&clock_)); 170 bitrate_estimator_.reset(new DelayBasedBwe(&clock_));
174 } 171 }
175 172
173 private:
176 test::ScopedFieldTrials override_field_trials_; 174 test::ScopedFieldTrials override_field_trials_;
177 }; 175 };
178 176
179 TEST_F(DelayBasedBweExperimentTest, RateIncreaseRtpTimestamps) { 177 TEST_F(DelayBasedBweExperimentTest, RateIncreaseRtpTimestamps) {
180 RateIncreaseRtpTimestampsTestHelper(1288); 178 RateIncreaseRtpTimestampsTestHelper(1288);
181 } 179 }
182 180
183 TEST_F(DelayBasedBweExperimentTest, CapacityDropOneStream) { 181 TEST_F(DelayBasedBweExperimentTest, CapacityDropOneStream) {
184 CapacityDropTestHelper(1, false, 333, 0); 182 CapacityDropTestHelper(1, false, 333, 0);
185 } 183 }
186 184
187 TEST_F(DelayBasedBweExperimentTest, CapacityDropPosOffsetChange) { 185 TEST_F(DelayBasedBweExperimentTest, CapacityDropPosOffsetChange) {
188 CapacityDropTestHelper(1, false, 300, 30000); 186 CapacityDropTestHelper(1, false, 300, 30000);
189 } 187 }
190 188
191 TEST_F(DelayBasedBweExperimentTest, CapacityDropNegOffsetChange) { 189 TEST_F(DelayBasedBweExperimentTest, CapacityDropNegOffsetChange) {
192 CapacityDropTestHelper(1, false, 300, -30000); 190 CapacityDropTestHelper(1, false, 300, -30000);
193 } 191 }
194 192
195 TEST_F(DelayBasedBweExperimentTest, CapacityDropOneStreamWrap) { 193 TEST_F(DelayBasedBweExperimentTest, CapacityDropOneStreamWrap) {
196 CapacityDropTestHelper(1, true, 333, 0); 194 CapacityDropTestHelper(1, true, 333, 0);
197 } 195 }
198 196
199 class DelayBasedBweTrendlineExperimentTest : public DelayBasedBweTest { 197 class DelayBasedBweTrendlineExperimentTest : public DelayBasedBweTest {
200 public: 198 public:
201 DelayBasedBweTrendlineExperimentTest() 199 DelayBasedBweTrendlineExperimentTest()
202 : override_field_trials_("WebRTC-BweTrendlineFilter/Enabled-15,0.9,4/") {} 200 : override_field_trials_("WebRTC-BweTrendlineFilter/Enabled-15,0.9,4/") {
203
204 protected:
205 void SetUp() override {
206 bitrate_estimator_.reset(new DelayBasedBwe(&clock_)); 201 bitrate_estimator_.reset(new DelayBasedBwe(&clock_));
207 } 202 }
208 203
204 private:
209 test::ScopedFieldTrials override_field_trials_; 205 test::ScopedFieldTrials override_field_trials_;
210 }; 206 };
211 207
212 TEST_F(DelayBasedBweTrendlineExperimentTest, RateIncreaseRtpTimestamps) { 208 TEST_F(DelayBasedBweTrendlineExperimentTest, RateIncreaseRtpTimestamps) {
213 RateIncreaseRtpTimestampsTestHelper(1240); 209 RateIncreaseRtpTimestampsTestHelper(1240);
214 } 210 }
215 211
216 TEST_F(DelayBasedBweTrendlineExperimentTest, CapacityDropOneStream) { 212 TEST_F(DelayBasedBweTrendlineExperimentTest, CapacityDropOneStream) {
217 CapacityDropTestHelper(1, false, 600, 0); 213 CapacityDropTestHelper(1, false, 600, 0);
218 } 214 }
219 215
220 TEST_F(DelayBasedBweTrendlineExperimentTest, CapacityDropPosOffsetChange) { 216 TEST_F(DelayBasedBweTrendlineExperimentTest, CapacityDropPosOffsetChange) {
221 CapacityDropTestHelper(1, false, 600, 30000); 217 CapacityDropTestHelper(1, false, 600, 30000);
222 } 218 }
223 219
224 TEST_F(DelayBasedBweTrendlineExperimentTest, CapacityDropNegOffsetChange) { 220 TEST_F(DelayBasedBweTrendlineExperimentTest, CapacityDropNegOffsetChange) {
225 CapacityDropTestHelper(1, false, 1267, -30000); 221 CapacityDropTestHelper(1, false, 1267, -30000);
226 } 222 }
227 223
228 TEST_F(DelayBasedBweTrendlineExperimentTest, CapacityDropOneStreamWrap) { 224 TEST_F(DelayBasedBweTrendlineExperimentTest, CapacityDropOneStreamWrap) {
229 CapacityDropTestHelper(1, true, 600, 0); 225 CapacityDropTestHelper(1, true, 600, 0);
230 } 226 }
231 227
228 class DelayBasedBweTheilSenExperimentTest : public DelayBasedBweTest {
229 public:
230 DelayBasedBweTheilSenExperimentTest()
231 : override_field_trials_("WebRTC-BweTheilSenFilter/Enabled-20,4/") {
232 bitrate_estimator_.reset(new DelayBasedBwe(&clock_));
233 }
234
235 private:
236 test::ScopedFieldTrials override_field_trials_;
237 };
238
239 TEST_F(DelayBasedBweTheilSenExperimentTest, RateIncreaseRtpTimestamps) {
240 RateIncreaseRtpTimestampsTestHelper(1240);
241 }
242
243 TEST_F(DelayBasedBweTheilSenExperimentTest, CapacityDropOneStream) {
244 CapacityDropTestHelper(1, false, 600, 0);
245 }
246
247 TEST_F(DelayBasedBweTheilSenExperimentTest, CapacityDropPosOffsetChange) {
248 CapacityDropTestHelper(1, false, 600, 30000);
249 }
250
251 TEST_F(DelayBasedBweTheilSenExperimentTest, CapacityDropNegOffsetChange) {
252 CapacityDropTestHelper(1, false, 1267, -30000);
253 }
254
255 TEST_F(DelayBasedBweTheilSenExperimentTest, CapacityDropOneStreamWrap) {
256 CapacityDropTestHelper(1, true, 600, 0);
257 }
258
232 } // namespace webrtc 259 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698