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

Side by Side Diff: webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimators_test.cc

Issue 1202253003: More Simulation Framework features (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Using rtc::scoped_ptr on nada_unittest.cc Created 5 years, 5 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) 2013 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2013 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 loss.SetLoss(i); 63 loss.SetLoss(i);
64 RunFor(5000); 64 RunFor(5000);
65 } 65 }
66 } 66 }
67 67
68 TEST_P(DefaultBweTest, SteadyDelay) { 68 TEST_P(DefaultBweTest, SteadyDelay) {
69 VideoSource source(0, 30, 300, 0, 0); 69 VideoSource source(0, 30, 300, 0, 0);
70 VideoSender sender(&uplink_, &source, GetParam()); 70 VideoSender sender(&uplink_, &source, GetParam());
71 DelayFilter delay(&uplink_, 0); 71 DelayFilter delay(&uplink_, 0);
72 PacketReceiver receiver(&uplink_, 0, GetParam(), false, false); 72 PacketReceiver receiver(&uplink_, 0, GetParam(), false, false);
73 delay.SetDelayMs(1000); 73 delay.SetOneWayDelayMs(1000);
74 RunFor(10 * 60 * 1000); 74 RunFor(10 * 60 * 1000);
75 } 75 }
76 76
77 TEST_P(DefaultBweTest, IncreasingDelay1) { 77 TEST_P(DefaultBweTest, IncreasingDelay1) {
78 VideoSource source(0, 30, 300, 0, 0); 78 VideoSource source(0, 30, 300, 0, 0);
79 VideoSender sender(&uplink_, &source, GetParam()); 79 VideoSender sender(&uplink_, &source, GetParam());
80 DelayFilter delay(&uplink_, 0); 80 DelayFilter delay(&uplink_, 0);
81 PacketReceiver receiver(&uplink_, 0, GetParam(), false, false); 81 PacketReceiver receiver(&uplink_, 0, GetParam(), false, false);
82 RunFor(10 * 60 * 1000); 82 RunFor(10 * 60 * 1000);
83 for (int i = 0; i < 30 * 2; ++i) { 83 for (int i = 0; i < 30 * 2; ++i) {
84 delay.SetDelayMs(i); 84 delay.SetOneWayDelayMs(i);
85 RunFor(10 * 1000); 85 RunFor(10 * 1000);
86 } 86 }
87 RunFor(10 * 60 * 1000); 87 RunFor(10 * 60 * 1000);
88 } 88 }
89 89
90 TEST_P(DefaultBweTest, IncreasingDelay2) { 90 TEST_P(DefaultBweTest, IncreasingDelay2) {
91 VideoSource source(0, 30, 300, 0, 0); 91 VideoSource source(0, 30, 300, 0, 0);
92 VideoSender sender(&uplink_, &source, GetParam()); 92 VideoSender sender(&uplink_, &source, GetParam());
93 DelayFilter delay(&uplink_, 0); 93 DelayFilter delay(&uplink_, 0);
94 RateCounterFilter counter(&uplink_, 0, ""); 94 RateCounterFilter counter(&uplink_, 0, "");
95 PacketReceiver receiver(&uplink_, 0, GetParam(), false, false); 95 PacketReceiver receiver(&uplink_, 0, GetParam(), false, false);
96 RunFor(1 * 60 * 1000); 96 RunFor(1 * 60 * 1000);
97 for (int i = 1; i < 51; ++i) { 97 for (int i = 1; i < 51; ++i) {
98 delay.SetDelayMs(10.0f * i); 98 delay.SetOneWayDelayMs(10.0f * i);
99 RunFor(10 * 1000); 99 RunFor(10 * 1000);
100 } 100 }
101 delay.SetDelayMs(0.0f); 101 delay.SetOneWayDelayMs(0.0f);
102 RunFor(10 * 60 * 1000); 102 RunFor(10 * 60 * 1000);
103 } 103 }
104 104
105 TEST_P(DefaultBweTest, JumpyDelay1) { 105 TEST_P(DefaultBweTest, JumpyDelay1) {
106 VideoSource source(0, 30, 300, 0, 0); 106 VideoSource source(0, 30, 300, 0, 0);
107 VideoSender sender(&uplink_, &source, GetParam()); 107 VideoSender sender(&uplink_, &source, GetParam());
108 DelayFilter delay(&uplink_, 0); 108 DelayFilter delay(&uplink_, 0);
109 PacketReceiver receiver(&uplink_, 0, GetParam(), false, false); 109 PacketReceiver receiver(&uplink_, 0, GetParam(), false, false);
110 RunFor(10 * 60 * 1000); 110 RunFor(10 * 60 * 1000);
111 for (int i = 1; i < 200; ++i) { 111 for (int i = 1; i < 200; ++i) {
112 delay.SetDelayMs((10 * i) % 500); 112 delay.SetOneWayDelayMs((10 * i) % 500);
113 RunFor(1000); 113 RunFor(1000);
114 delay.SetDelayMs(1.0f); 114 delay.SetOneWayDelayMs(1.0f);
115 RunFor(1000); 115 RunFor(1000);
116 } 116 }
117 delay.SetDelayMs(0.0f); 117 delay.SetOneWayDelayMs(0.0f);
118 RunFor(10 * 60 * 1000); 118 RunFor(10 * 60 * 1000);
119 } 119 }
120 120
121 TEST_P(DefaultBweTest, SteadyJitter) { 121 TEST_P(DefaultBweTest, SteadyJitter) {
122 VideoSource source(0, 30, 300, 0, 0); 122 VideoSource source(0, 30, 300, 0, 0);
123 VideoSender sender(&uplink_, &source, GetParam()); 123 VideoSender sender(&uplink_, &source, GetParam());
124 JitterFilter jitter(&uplink_, 0); 124 JitterFilter jitter(&uplink_, 0);
125 RateCounterFilter counter(&uplink_, 0, ""); 125 RateCounterFilter counter(&uplink_, 0, "");
126 PacketReceiver receiver(&uplink_, 0, GetParam(), false, false); 126 PacketReceiver receiver(&uplink_, 0, GetParam(), false, false);
127 jitter.SetJitter(20); 127 jitter.SetJitter(20);
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 reorder.SetReorder(i); 172 reorder.SetReorder(i);
173 RunFor(5000); 173 RunFor(5000);
174 } 174 }
175 } 175 }
176 176
177 TEST_P(DefaultBweTest, SteadyChoke) { 177 TEST_P(DefaultBweTest, SteadyChoke) {
178 VideoSource source(0, 30, 300, 0, 0); 178 VideoSource source(0, 30, 300, 0, 0);
179 VideoSender sender(&uplink_, &source, GetParam()); 179 VideoSender sender(&uplink_, &source, GetParam());
180 ChokeFilter choke(&uplink_, 0); 180 ChokeFilter choke(&uplink_, 0);
181 PacketReceiver receiver(&uplink_, 0, GetParam(), false, false); 181 PacketReceiver receiver(&uplink_, 0, GetParam(), false, false);
182 choke.SetCapacity(140); 182 choke.set_capacity_kbps(140);
183 RunFor(10 * 60 * 1000); 183 RunFor(10 * 60 * 1000);
184 } 184 }
185 185
186 TEST_P(DefaultBweTest, IncreasingChoke1) { 186 TEST_P(DefaultBweTest, IncreasingChoke1) {
187 VideoSource source(0, 30, 300, 0, 0); 187 VideoSource source(0, 30, 300, 0, 0);
188 VideoSender sender(&uplink_, &source, GetParam()); 188 VideoSender sender(&uplink_, &source, GetParam());
189 ChokeFilter choke(&uplink_, 0); 189 ChokeFilter choke(&uplink_, 0);
190 PacketReceiver receiver(&uplink_, 0, GetParam(), false, false); 190 PacketReceiver receiver(&uplink_, 0, GetParam(), false, false);
191 for (int i = 1200; i >= 100; i -= 100) { 191 for (int i = 1200; i >= 100; i -= 100) {
192 choke.SetCapacity(i); 192 choke.set_capacity_kbps(i);
193 RunFor(5000); 193 RunFor(5000);
194 } 194 }
195 } 195 }
196 196
197 TEST_P(DefaultBweTest, IncreasingChoke2) { 197 TEST_P(DefaultBweTest, IncreasingChoke2) {
198 VideoSource source(0, 30, 300, 0, 0); 198 VideoSource source(0, 30, 300, 0, 0);
199 VideoSender sender(&uplink_, &source, GetParam()); 199 VideoSender sender(&uplink_, &source, GetParam());
200 ChokeFilter choke(&uplink_, 0); 200 ChokeFilter choke(&uplink_, 0);
201 PacketReceiver receiver(&uplink_, 0, GetParam(), false, false); 201 PacketReceiver receiver(&uplink_, 0, GetParam(), false, false);
202 RunFor(60 * 1000); 202 RunFor(60 * 1000);
203 for (int i = 1200; i >= 100; i -= 20) { 203 for (int i = 1200; i >= 100; i -= 20) {
204 choke.SetCapacity(i); 204 choke.set_capacity_kbps(i);
205 RunFor(1000); 205 RunFor(1000);
206 } 206 }
207 } 207 }
208 208
209 TEST_P(DefaultBweTest, Multi1) { 209 TEST_P(DefaultBweTest, Multi1) {
210 VideoSource source(0, 30, 300, 0, 0); 210 VideoSource source(0, 30, 300, 0, 0);
211 VideoSender sender(&uplink_, &source, GetParam()); 211 VideoSender sender(&uplink_, &source, GetParam());
212 DelayFilter delay(&uplink_, 0); 212 DelayFilter delay(&uplink_, 0);
213 ChokeFilter choke(&uplink_, 0); 213 ChokeFilter choke(&uplink_, 0);
214 RateCounterFilter counter(&uplink_, 0, ""); 214 RateCounterFilter counter(&uplink_, 0, "");
215 PacketReceiver receiver(&uplink_, 0, GetParam(), false, false); 215 PacketReceiver receiver(&uplink_, 0, GetParam(), false, false);
216 choke.SetCapacity(1000); 216 choke.set_capacity_kbps(1000);
217 RunFor(1 * 60 * 1000); 217 RunFor(1 * 60 * 1000);
218 for (int i = 1; i < 51; ++i) { 218 for (int i = 1; i < 51; ++i) {
219 delay.SetDelayMs(100.0f * i); 219 delay.SetOneWayDelayMs(100.0f * i);
220 RunFor(10 * 1000); 220 RunFor(10 * 1000);
221 } 221 }
222 RunFor(500 * 1000); 222 RunFor(500 * 1000);
223 delay.SetDelayMs(0.0f); 223 delay.SetOneWayDelayMs(0.0f);
224 RunFor(5 * 60 * 1000); 224 RunFor(5 * 60 * 1000);
225 } 225 }
226 226
227 TEST_P(DefaultBweTest, Multi2) { 227 TEST_P(DefaultBweTest, Multi2) {
228 VideoSource source(0, 30, 300, 0, 0); 228 VideoSource source(0, 30, 300, 0, 0);
229 VideoSender sender(&uplink_, &source, GetParam()); 229 VideoSender sender(&uplink_, &source, GetParam());
230 ChokeFilter choke(&uplink_, 0); 230 ChokeFilter choke(&uplink_, 0);
231 JitterFilter jitter(&uplink_, 0); 231 JitterFilter jitter(&uplink_, 0);
232 RateCounterFilter counter(&uplink_, 0, ""); 232 RateCounterFilter counter(&uplink_, 0, "");
233 PacketReceiver receiver(&uplink_, 0, GetParam(), false, false); 233 PacketReceiver receiver(&uplink_, 0, GetParam(), false, false);
234 choke.SetCapacity(2000); 234 choke.set_capacity_kbps(2000);
235 jitter.SetJitter(120); 235 jitter.SetJitter(120);
236 RunFor(5 * 60 * 1000); 236 RunFor(5 * 60 * 1000);
237 } 237 }
238 238
239 // This test fixture is used to instantiate tests running with adaptive video 239 // This test fixture is used to instantiate tests running with adaptive video
240 // senders. 240 // senders.
241 class BweFeedbackTest 241 class BweFeedbackTest
242 : public BweTest, 242 : public BweTest,
243 public ::testing::TestWithParam<BandwidthEstimatorType> { 243 public ::testing::TestWithParam<BandwidthEstimatorType> {
244 public: 244 public:
(...skipping 19 matching lines...) Expand all
264 ::testing::Values(kRembEstimator, 264 ::testing::Values(kRembEstimator,
265 kFullSendSideEstimator)); 265 kFullSendSideEstimator));
266 266
267 TEST_P(BweFeedbackTest, ConstantCapacity) { 267 TEST_P(BweFeedbackTest, ConstantCapacity) {
268 AdaptiveVideoSource source(0, 30, 300, 0, 0); 268 AdaptiveVideoSource source(0, 30, 300, 0, 0);
269 PacedVideoSender sender(&uplink_, &source, GetParam()); 269 PacedVideoSender sender(&uplink_, &source, GetParam());
270 ChokeFilter filter(&uplink_, 0); 270 ChokeFilter filter(&uplink_, 0);
271 RateCounterFilter counter(&uplink_, 0, "receiver_input"); 271 RateCounterFilter counter(&uplink_, 0, "receiver_input");
272 PacketReceiver receiver(&uplink_, 0, GetParam(), false, false); 272 PacketReceiver receiver(&uplink_, 0, GetParam(), false, false);
273 const int kCapacityKbps = 1000; 273 const int kCapacityKbps = 1000;
274 filter.SetCapacity(kCapacityKbps); 274 filter.set_capacity_kbps(kCapacityKbps);
275 filter.SetMaxDelay(500); 275 filter.set_max_delay_ms(500);
276 RunFor(180 * 1000); 276 RunFor(180 * 1000);
277 PrintResults(kCapacityKbps, counter.GetBitrateStats(), 0, 277 PrintResults(kCapacityKbps, counter.GetBitrateStats(), 0,
278 receiver.GetDelayStats(), counter.GetBitrateStats()); 278 receiver.GetDelayStats(), counter.GetBitrateStats());
279 } 279 }
280 280
281 TEST_P(BweFeedbackTest, Choke1000kbps500kbps1000kbps) { 281 TEST_P(BweFeedbackTest, Choke1000kbps500kbps1000kbps) {
282 AdaptiveVideoSource source(0, 30, 300, 0, 0); 282 AdaptiveVideoSource source(0, 30, 300, 0, 0);
283 PacedVideoSender sender(&uplink_, &source, GetParam()); 283 PacedVideoSender sender(&uplink_, &source, GetParam());
284 ChokeFilter filter(&uplink_, 0); 284 ChokeFilter filter(&uplink_, 0);
285 RateCounterFilter counter(&uplink_, 0, "receiver_input"); 285 RateCounterFilter counter(&uplink_, 0, "receiver_input");
286 PacketReceiver receiver(&uplink_, 0, GetParam(), false, false); 286 PacketReceiver receiver(&uplink_, 0, GetParam(), false, false);
287 const int kHighCapacityKbps = 1000; 287 const int kHighCapacityKbps = 1000;
288 const int kLowCapacityKbps = 500; 288 const int kLowCapacityKbps = 500;
289 filter.SetCapacity(kHighCapacityKbps); 289 filter.set_capacity_kbps(kHighCapacityKbps);
290 filter.SetMaxDelay(500); 290 filter.set_max_delay_ms(500);
291 RunFor(60 * 1000); 291 RunFor(60 * 1000);
292 filter.SetCapacity(kLowCapacityKbps); 292 filter.set_capacity_kbps(kLowCapacityKbps);
293 RunFor(60 * 1000); 293 RunFor(60 * 1000);
294 filter.SetCapacity(kHighCapacityKbps); 294 filter.set_capacity_kbps(kHighCapacityKbps);
295 RunFor(60 * 1000); 295 RunFor(60 * 1000);
296 PrintResults((2 * kHighCapacityKbps + kLowCapacityKbps) / 3.0, 296 PrintResults((2 * kHighCapacityKbps + kLowCapacityKbps) / 3.0,
297 counter.GetBitrateStats(), 0, receiver.GetDelayStats(), 297 counter.GetBitrateStats(), 0, receiver.GetDelayStats(),
298 counter.GetBitrateStats()); 298 counter.GetBitrateStats());
299 } 299 }
300 300
301 TEST_P(BweFeedbackTest, Choke200kbps30kbps200kbps) { 301 TEST_P(BweFeedbackTest, Choke200kbps30kbps200kbps) {
302 AdaptiveVideoSource source(0, 30, 300, 0, 0); 302 AdaptiveVideoSource source(0, 30, 300, 0, 0);
303 PacedVideoSender sender(&uplink_, &source, GetParam()); 303 PacedVideoSender sender(&uplink_, &source, GetParam());
304 ChokeFilter filter(&uplink_, 0); 304 ChokeFilter filter(&uplink_, 0);
305 RateCounterFilter counter(&uplink_, 0, "receiver_input"); 305 RateCounterFilter counter(&uplink_, 0, "receiver_input");
306 PacketReceiver receiver(&uplink_, 0, GetParam(), false, false); 306 PacketReceiver receiver(&uplink_, 0, GetParam(), false, false);
307 const int kHighCapacityKbps = 200; 307 const int kHighCapacityKbps = 200;
308 const int kLowCapacityKbps = 30; 308 const int kLowCapacityKbps = 30;
309 filter.SetCapacity(kHighCapacityKbps); 309 filter.set_capacity_kbps(kHighCapacityKbps);
310 filter.SetMaxDelay(500); 310 filter.set_max_delay_ms(500);
311 RunFor(60 * 1000); 311 RunFor(60 * 1000);
312 filter.SetCapacity(kLowCapacityKbps); 312 filter.set_capacity_kbps(kLowCapacityKbps);
313 RunFor(60 * 1000); 313 RunFor(60 * 1000);
314 filter.SetCapacity(kHighCapacityKbps); 314 filter.set_capacity_kbps(kHighCapacityKbps);
315 RunFor(60 * 1000); 315 RunFor(60 * 1000);
316 316
317 PrintResults((2 * kHighCapacityKbps + kLowCapacityKbps) / 3.0, 317 PrintResults((2 * kHighCapacityKbps + kLowCapacityKbps) / 3.0,
318 counter.GetBitrateStats(), 0, receiver.GetDelayStats(), 318 counter.GetBitrateStats(), 0, receiver.GetDelayStats(),
319 counter.GetBitrateStats()); 319 counter.GetBitrateStats());
320 } 320 }
321 321
322 TEST_P(BweFeedbackTest, Verizon4gDownlinkTest) { 322 TEST_P(BweFeedbackTest, Verizon4gDownlinkTest) {
323 AdaptiveVideoSource source(0, 30, 300, 0, 0); 323 AdaptiveVideoSource source(0, 30, 300, 0, 0);
324 VideoSender sender(&uplink_, &source, GetParam()); 324 VideoSender sender(&uplink_, &source, GetParam());
325 RateCounterFilter counter1(&uplink_, 0, "sender_output"); 325 RateCounterFilter counter1(&uplink_, 0, "sender_output");
326 TraceBasedDeliveryFilter filter(&uplink_, 0, "link_capacity"); 326 TraceBasedDeliveryFilter filter(&uplink_, 0, "link_capacity");
327 RateCounterFilter counter2(&uplink_, 0, "receiver_input"); 327 RateCounterFilter counter2(&uplink_, 0, "receiver_input");
328 PacketReceiver receiver(&uplink_, 0, GetParam(), false, false); 328 PacketReceiver receiver(&uplink_, 0, GetParam(), false, false);
329 ASSERT_TRUE(filter.Init(test::ResourcePath("verizon4g-downlink", "rx"))); 329 ASSERT_TRUE(filter.Init(test::ResourcePath("verizon4g-downlink", "rx")));
330 RunFor(22 * 60 * 1000); 330 RunFor(22 * 60 * 1000);
331 PrintResults(filter.GetBitrateStats().GetMean(), counter2.GetBitrateStats(), 331 PrintResults(filter.GetBitrateStats().GetMean(), counter2.GetBitrateStats(),
332 0, receiver.GetDelayStats(), counter2.GetBitrateStats()); 332 0, receiver.GetDelayStats(), counter2.GetBitrateStats());
333 } 333 }
334 334
335 // webrtc:3277 335 // webrtc:3277
336 TEST_P(BweFeedbackTest, GoogleWifiTrace3Mbps) { 336 TEST_P(BweFeedbackTest, GoogleWifiTrace3Mbps) {
337 AdaptiveVideoSource source(0, 30, 300, 0, 0); 337 AdaptiveVideoSource source(0, 30, 300, 0, 0);
338 VideoSender sender(&uplink_, &source, GetParam()); 338 VideoSender sender(&uplink_, &source, GetParam());
339 RateCounterFilter counter1(&uplink_, 0, "sender_output"); 339 RateCounterFilter counter1(&uplink_, 0, "sender_output");
340 TraceBasedDeliveryFilter filter(&uplink_, 0, "link_capacity"); 340 TraceBasedDeliveryFilter filter(&uplink_, 0, "link_capacity");
341 filter.SetMaxDelay(500); 341 filter.set_max_delay_ms(500);
342 RateCounterFilter counter2(&uplink_, 0, "receiver_input"); 342 RateCounterFilter counter2(&uplink_, 0, "receiver_input");
343 PacketReceiver receiver(&uplink_, 0, GetParam(), false, false); 343 PacketReceiver receiver(&uplink_, 0, GetParam(), false, false);
344 ASSERT_TRUE(filter.Init(test::ResourcePath("google-wifi-3mbps", "rx"))); 344 ASSERT_TRUE(filter.Init(test::ResourcePath("google-wifi-3mbps", "rx")));
345 RunFor(300 * 1000); 345 RunFor(300 * 1000);
346 PrintResults(filter.GetBitrateStats().GetMean(), counter2.GetBitrateStats(), 346 PrintResults(filter.GetBitrateStats().GetMean(), counter2.GetBitrateStats(),
347 0, receiver.GetDelayStats(), counter2.GetBitrateStats()); 347 0, receiver.GetDelayStats(), counter2.GetBitrateStats());
348 } 348 }
349 349
350 TEST_P(BweFeedbackTest, PacedSelfFairness50msTest) { 350 TEST_P(BweFeedbackTest, PacedSelfFairness50msTest) {
351 RunFairnessTest(GetParam(), 4, 0, 300, 3000, 50); 351 RunFairnessTest(GetParam(), 4, 0, 300, 3000, 50);
(...skipping 14 matching lines...) Expand all
366 TEST_P(BweFeedbackTest, TcpFairness500msTest) { 366 TEST_P(BweFeedbackTest, TcpFairness500msTest) {
367 RunFairnessTest(GetParam(), 1, 1, 300, 2000, 500); 367 RunFairnessTest(GetParam(), 1, 1, 300, 2000, 500);
368 } 368 }
369 369
370 TEST_P(BweFeedbackTest, TcpFairness1000msTest) { 370 TEST_P(BweFeedbackTest, TcpFairness1000msTest) {
371 RunFairnessTest(GetParam(), 1, 1, 300, 2000, 1000); 371 RunFairnessTest(GetParam(), 1, 1, 300, 2000, 1000);
372 } 372 }
373 } // namespace bwe 373 } // namespace bwe
374 } // namespace testing 374 } // namespace testing
375 } // namespace webrtc 375 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698