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

Side by Side Diff: webrtc/video/rampup_tests.cc

Issue 1487893004: Replace EventWrapper in video/, test/ and call/. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 5 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) 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 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 // For tests with an explicitly set start bitrate, verify the first 197 // For tests with an explicitly set start bitrate, verify the first
198 // bitrate estimate is close to the start bitrate and lower than the 198 // bitrate estimate is close to the start bitrate and lower than the
199 // test target bitrate. This is to verify a call respects the configured 199 // test target bitrate. This is to verify a call respects the configured
200 // start bitrate, but due to the BWE implementation we can't guarantee the 200 // start bitrate, but due to the BWE implementation we can't guarantee the
201 // first estimate really is as high as the start bitrate. 201 // first estimate really is as high as the start bitrate.
202 EXPECT_GT(stats.send_bandwidth_bps, 0.9 * start_bitrate_bps_); 202 EXPECT_GT(stats.send_bandwidth_bps, 0.9 * start_bitrate_bps_);
203 start_bitrate_verified_ = true; 203 start_bitrate_verified_ = true;
204 } 204 }
205 if (stats.send_bandwidth_bps >= expected_bitrate_bps_) { 205 if (stats.send_bandwidth_bps >= expected_bitrate_bps_) {
206 ramp_up_finished_ms_ = clock_->TimeInMilliseconds(); 206 ramp_up_finished_ms_ = clock_->TimeInMilliseconds();
207 observation_complete_->Set(); 207 observation_complete_.Set();
208 } 208 }
209 } 209 }
210 210
211 return !event_.Wait(kPollIntervalMs); 211 return !event_.Wait(kPollIntervalMs);
212 } 212 }
213 213
214 void RampUpTester::ReportResult(const std::string& measurement, 214 void RampUpTester::ReportResult(const std::string& measurement,
215 size_t value, 215 size_t value,
216 const std::string& units) const { 216 const std::string& units) const {
217 webrtc::test::PrintResult( 217 webrtc::test::PrintResult(
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 ReportResult("ramp-up-rtx-padding-sent", rtx_padding_sent, "bytes"); 271 ReportResult("ramp-up-rtx-padding-sent", rtx_padding_sent, "bytes");
272 if (ramp_up_finished_ms_ >= 0) { 272 if (ramp_up_finished_ms_ >= 0) {
273 ReportResult("ramp-up-time", ramp_up_finished_ms_ - test_start_ms_, 273 ReportResult("ramp-up-time", ramp_up_finished_ms_ - test_start_ms_,
274 "milliseconds"); 274 "milliseconds");
275 } 275 }
276 } 276 }
277 277
278 void RampUpTester::PerformTest() { 278 void RampUpTester::PerformTest() {
279 test_start_ms_ = clock_->TimeInMilliseconds(); 279 test_start_ms_ = clock_->TimeInMilliseconds();
280 poller_thread_.Start(); 280 poller_thread_.Start();
281 EXPECT_EQ(kEventSignaled, Wait()) 281 EXPECT_TRUE(Wait()) << "Timed out while waiting for ramp-up to complete.";
282 << "Timed out while waiting for ramp-up to complete.";
283 TriggerTestDone(); 282 TriggerTestDone();
284 poller_thread_.Stop(); 283 poller_thread_.Stop();
285 } 284 }
286 285
287 RampUpDownUpTester::RampUpDownUpTester(size_t num_streams, 286 RampUpDownUpTester::RampUpDownUpTester(size_t num_streams,
288 unsigned int start_bitrate_bps, 287 unsigned int start_bitrate_bps,
289 const std::string& extension_type, 288 const std::string& extension_type,
290 bool rtx, 289 bool rtx,
291 bool red) 290 bool red)
292 : RampUpTester(num_streams, start_bitrate_bps, extension_type, rtx, red), 291 : RampUpTester(num_streams, start_bitrate_bps, extension_type, rtx, red),
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
378 break; 377 break;
379 } 378 }
380 case kSecondRampup: { 379 case kSecondRampup: {
381 if (bitrate_bps > kExpectedHighBitrateBps && !suspended) { 380 if (bitrate_bps > kExpectedHighBitrateBps && !suspended) {
382 webrtc::test::PrintResult("ramp_up_down_up", 381 webrtc::test::PrintResult("ramp_up_down_up",
383 GetModifierString(), 382 GetModifierString(),
384 "second_rampup", 383 "second_rampup",
385 now - state_start_ms_, 384 now - state_start_ms_,
386 "ms", 385 "ms",
387 false); 386 false);
388 observation_complete_->Set(); 387 observation_complete_.Set();
389 } 388 }
390 break; 389 break;
391 } 390 }
392 } 391 }
393 } 392 }
394 393
395 class RampUpTest : public test::CallTest { 394 class RampUpTest : public test::CallTest {
396 public: 395 public:
397 RampUpTest() {} 396 RampUpTest() {}
398 397
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
503 RampUpTester test(3, 0, RtpExtension::kTransportSequenceNumber, true, true); 502 RampUpTester test(3, 0, RtpExtension::kTransportSequenceNumber, true, true);
504 RunBaseTest(&test, FakeNetworkPipe::Config()); 503 RunBaseTest(&test, FakeNetworkPipe::Config());
505 } 504 }
506 505
507 TEST_F(RampUpTest, TransportSequenceNumberSingleStreamWithHighStartBitrate) { 506 TEST_F(RampUpTest, TransportSequenceNumberSingleStreamWithHighStartBitrate) {
508 RampUpTester test(1, 0.9 * kSingleStreamTargetBps, 507 RampUpTester test(1, 0.9 * kSingleStreamTargetBps,
509 RtpExtension::kTransportSequenceNumber, false, false); 508 RtpExtension::kTransportSequenceNumber, false, false);
510 RunBaseTest(&test, FakeNetworkPipe::Config()); 509 RunBaseTest(&test, FakeNetworkPipe::Config());
511 } 510 }
512 } // namespace webrtc 511 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698