| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2014 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 bwe_names[GetParam()] + "_up"); | 67 bwe_names[GetParam()] + "_up"); |
| 68 TraceBasedDeliveryFilter filter(&downlink_, 0, "link_capacity"); | 68 TraceBasedDeliveryFilter filter(&downlink_, 0, "link_capacity"); |
| 69 RateCounterFilter counter2(&downlink_, 0, "Receiver", | 69 RateCounterFilter counter2(&downlink_, 0, "Receiver", |
| 70 bwe_names[GetParam()] + "_down"); | 70 bwe_names[GetParam()] + "_down"); |
| 71 PacketReceiver receiver(&downlink_, 0, GetParam(), true, true); | 71 PacketReceiver receiver(&downlink_, 0, GetParam(), true, true); |
| 72 ASSERT_TRUE(filter.Init(test::ResourcePath("verizon4g-downlink", "rx"))); | 72 ASSERT_TRUE(filter.Init(test::ResourcePath("verizon4g-downlink", "rx"))); |
| 73 RunFor(22 * 60 * 1000); | 73 RunFor(22 * 60 * 1000); |
| 74 } | 74 } |
| 75 | 75 |
| 76 TEST_P(BweSimulation, Choke1000kbps500kbps1000kbpsBiDirectional) { | 76 TEST_P(BweSimulation, Choke1000kbps500kbps1000kbpsBiDirectional) { |
| 77 | |
| 78 const int kFlowIds[] = {0, 1}; | 77 const int kFlowIds[] = {0, 1}; |
| 79 const size_t kNumFlows = sizeof(kFlowIds) / sizeof(kFlowIds[0]); | 78 const size_t kNumFlows = sizeof(kFlowIds) / sizeof(kFlowIds[0]); |
| 80 | 79 |
| 81 AdaptiveVideoSource source(kFlowIds[0], 30, 300, 0, 0); | 80 AdaptiveVideoSource source(kFlowIds[0], 30, 300, 0, 0); |
| 82 VideoSender sender(&uplink_, &source, GetParam()); | 81 VideoSender sender(&uplink_, &source, GetParam()); |
| 83 ChokeFilter choke(&uplink_, kFlowIds[0]); | 82 ChokeFilter choke(&uplink_, kFlowIds[0]); |
| 84 RateCounterFilter counter(&uplink_, kFlowIds[0], "Receiver_0", | 83 RateCounterFilter counter(&uplink_, kFlowIds[0], "Receiver_0", |
| 85 bwe_names[GetParam()]); | 84 bwe_names[GetParam()]); |
| 86 PacketReceiver receiver(&uplink_, kFlowIds[0], GetParam(), true, false); | 85 PacketReceiver receiver(&uplink_, kFlowIds[0], GetParam(), true, false); |
| 87 | 86 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 99 choke.set_capacity_kbps(1000); | 98 choke.set_capacity_kbps(1000); |
| 100 choke.set_max_delay_ms(500); | 99 choke.set_max_delay_ms(500); |
| 101 RunFor(60 * 1000); | 100 RunFor(60 * 1000); |
| 102 choke.set_capacity_kbps(500); | 101 choke.set_capacity_kbps(500); |
| 103 RunFor(60 * 1000); | 102 RunFor(60 * 1000); |
| 104 choke.set_capacity_kbps(1000); | 103 choke.set_capacity_kbps(1000); |
| 105 RunFor(60 * 1000); | 104 RunFor(60 * 1000); |
| 106 } | 105 } |
| 107 | 106 |
| 108 TEST_P(BweSimulation, Choke1000kbps500kbps1000kbps) { | 107 TEST_P(BweSimulation, Choke1000kbps500kbps1000kbps) { |
| 109 | |
| 110 AdaptiveVideoSource source(0, 30, 300, 0, 0); | 108 AdaptiveVideoSource source(0, 30, 300, 0, 0); |
| 111 VideoSender sender(&uplink_, &source, GetParam()); | 109 VideoSender sender(&uplink_, &source, GetParam()); |
| 112 ChokeFilter choke(&uplink_, 0); | 110 ChokeFilter choke(&uplink_, 0); |
| 113 RateCounterFilter counter(&uplink_, 0, "Receiver", bwe_names[GetParam()]); | 111 RateCounterFilter counter(&uplink_, 0, "Receiver", bwe_names[GetParam()]); |
| 114 PacketReceiver receiver(&uplink_, 0, GetParam(), true, false); | 112 PacketReceiver receiver(&uplink_, 0, GetParam(), true, false); |
| 115 | 113 |
| 116 choke.set_capacity_kbps(1000); | 114 choke.set_capacity_kbps(1000); |
| 117 choke.set_max_delay_ms(500); | 115 choke.set_max_delay_ms(500); |
| 118 RunFor(60 * 1000); | 116 RunFor(60 * 1000); |
| 119 choke.set_capacity_kbps(500); | 117 choke.set_capacity_kbps(500); |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 bwe_names[GetParam()]); | 234 bwe_names[GetParam()]); |
| 237 TraceBasedDeliveryFilter filter(&uplink_, 0, "link_capacity"); | 235 TraceBasedDeliveryFilter filter(&uplink_, 0, "link_capacity"); |
| 238 filter.set_max_delay_ms(500); | 236 filter.set_max_delay_ms(500); |
| 239 RateCounterFilter counter2(&uplink_, 0, "Receiver", bwe_names[GetParam()]); | 237 RateCounterFilter counter2(&uplink_, 0, "Receiver", bwe_names[GetParam()]); |
| 240 PacketReceiver receiver(&uplink_, 0, GetParam(), true, true); | 238 PacketReceiver receiver(&uplink_, 0, GetParam(), true, true); |
| 241 ASSERT_TRUE(filter.Init(test::ResourcePath("google-wifi-3mbps", "rx"))); | 239 ASSERT_TRUE(filter.Init(test::ResourcePath("google-wifi-3mbps", "rx"))); |
| 242 RunFor(300 * 1000); | 240 RunFor(300 * 1000); |
| 243 } | 241 } |
| 244 | 242 |
| 245 TEST_P(BweSimulation, SelfFairnessTest) { | 243 TEST_P(BweSimulation, SelfFairnessTest) { |
| 246 srand(Clock::GetRealTimeClock()->TimeInMicroseconds()); | 244 Random prng(Clock::GetRealTimeClock()->TimeInMicroseconds()); |
| 247 const int kAllFlowIds[] = {0, 1, 2, 3}; | 245 const int kAllFlowIds[] = {0, 1, 2, 3}; |
| 248 const size_t kNumFlows = sizeof(kAllFlowIds) / sizeof(kAllFlowIds[0]); | 246 const size_t kNumFlows = sizeof(kAllFlowIds) / sizeof(kAllFlowIds[0]); |
| 249 rtc::scoped_ptr<VideoSource> sources[kNumFlows]; | 247 rtc::scoped_ptr<VideoSource> sources[kNumFlows]; |
| 250 rtc::scoped_ptr<VideoSender> senders[kNumFlows]; | 248 rtc::scoped_ptr<VideoSender> senders[kNumFlows]; |
| 251 for (size_t i = 0; i < kNumFlows; ++i) { | 249 for (size_t i = 0; i < kNumFlows; ++i) { |
| 252 // Streams started 20 seconds apart to give them different advantage when | 250 // Streams started 20 seconds apart to give them different advantage when |
| 253 // competing for the bandwidth. | 251 // competing for the bandwidth. |
| 254 sources[i].reset(new AdaptiveVideoSource(kAllFlowIds[i], 30, 300, 0, | 252 sources[i].reset(new AdaptiveVideoSource(kAllFlowIds[i], 30, 300, 0, |
| 255 i * (rand() % 40000))); | 253 i * prng.Rand(39999))); |
| 256 senders[i].reset(new VideoSender(&uplink_, sources[i].get(), GetParam())); | 254 senders[i].reset(new VideoSender(&uplink_, sources[i].get(), GetParam())); |
| 257 } | 255 } |
| 258 | 256 |
| 259 ChokeFilter choke(&uplink_, CreateFlowIds(kAllFlowIds, kNumFlows)); | 257 ChokeFilter choke(&uplink_, CreateFlowIds(kAllFlowIds, kNumFlows)); |
| 260 choke.set_capacity_kbps(1000); | 258 choke.set_capacity_kbps(1000); |
| 261 | 259 |
| 262 rtc::scoped_ptr<RateCounterFilter> rate_counters[kNumFlows]; | 260 rtc::scoped_ptr<RateCounterFilter> rate_counters[kNumFlows]; |
| 263 for (size_t i = 0; i < kNumFlows; ++i) { | 261 for (size_t i = 0; i < kNumFlows; ++i) { |
| 264 rate_counters[i].reset( | 262 rate_counters[i].reset( |
| 265 new RateCounterFilter(&uplink_, CreateFlowIds(&kAllFlowIds[i], 1), | 263 new RateCounterFilter(&uplink_, CreateFlowIds(&kAllFlowIds[i], 1), |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 443 | 441 |
| 444 BweTest gcc_test(false); | 442 BweTest gcc_test(false); |
| 445 gcc_test.RunChoke(kFullSendSideEstimator, capacities_kbps); | 443 gcc_test.RunChoke(kFullSendSideEstimator, capacities_kbps); |
| 446 } | 444 } |
| 447 | 445 |
| 448 #endif // BWE_TEST_LOGGING_COMPILE_TIME_ENABLE | 446 #endif // BWE_TEST_LOGGING_COMPILE_TIME_ENABLE |
| 449 } // namespace bwe | 447 } // namespace bwe |
| 450 } // namespace testing | 448 } // namespace testing |
| 451 } // namespace webrtc | 449 } // namespace webrtc |
| 452 | 450 |
| OLD | NEW |