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

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

Issue 2998793002: Fix (1) EndToEndTest.InitialProbing and (2) EndToEndTest.TriggerMidCallProbing (Closed)
Patch Set: Fix lacking initialization of a bool. Created 3 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include <algorithm> 10 #include <algorithm>
(...skipping 2288 matching lines...) Expand 10 before | Expand all | Expand 10 after
2299 Clock* const clock_; 2299 Clock* const clock_;
2300 const int start_bitrate_bps_; 2300 const int start_bitrate_bps_;
2301 int state_; 2301 int state_;
2302 Call* sender_call_; 2302 Call* sender_call_;
2303 }; 2303 };
2304 2304
2305 TEST_F(EndToEndTest, MAYBE_InitialProbing) { 2305 TEST_F(EndToEndTest, MAYBE_InitialProbing) {
2306 class InitialProbingTest : public ProbingTest { 2306 class InitialProbingTest : public ProbingTest {
2307 public: 2307 public:
2308 explicit InitialProbingTest(bool* success) 2308 explicit InitialProbingTest(bool* success)
2309 : ProbingTest(300000), success_(success) {} 2309 : ProbingTest(300000), success_(success) {
2310 *success_ = false;
eladalon 2017/08/10 15:07:21 This line was missing from this test, though not f
2311 }
2310 2312
2311 void PerformTest() override { 2313 void PerformTest() override {
2312 int64_t start_time_ms = clock_->TimeInMilliseconds(); 2314 int64_t start_time_ms = clock_->TimeInMilliseconds();
2313 do { 2315 do {
2314 if (clock_->TimeInMilliseconds() - start_time_ms > kTimeoutMs) 2316 if (clock_->TimeInMilliseconds() - start_time_ms > kTimeoutMs)
2315 break; 2317 break;
2316 2318
2317 Call::Stats stats = sender_call_->GetStats(); 2319 Call::Stats stats = sender_call_->GetStats();
2318 // Initial probing is done with a x3 and x6 multiplier of the start 2320 // Initial probing is done with a x3 and x6 multiplier of the start
2319 // bitrate, so a x4 multiplier is a high enough threshold. 2321 // bitrate, so a x4 multiplier is a high enough threshold.
2320 if (stats.send_bandwidth_bps > 4 * 300000) { 2322 if (stats.send_bandwidth_bps > 4 * 300000) {
2321 *success_ = true; 2323 *success_ = true;
2322 break; 2324 break;
2323 } 2325 }
2324 } while (!observation_complete_.Wait(20)); 2326 } while (!observation_complete_.Wait(20));
2325 } 2327 }
2326 2328
2327 private: 2329 private:
2328 const int kTimeoutMs = 1000; 2330 const int kTimeoutMs = 1000;
2329 bool* const success_; 2331 bool* const success_;
2330 }; 2332 };
2331 2333
2332 bool success; 2334 bool success = false;
eladalon 2017/08/10 15:07:21 This is not strictly necessary, because it happens
2333 const int kMaxAttempts = 3; 2335 const int kMaxAttempts = 3;
2334 for (int i = 0; i < kMaxAttempts; ++i) { 2336 for (int i = 0; i < kMaxAttempts; ++i) {
2335 InitialProbingTest test(&success); 2337 InitialProbingTest test(&success);
2336 RunBaseTest(&test); 2338 RunBaseTest(&test);
2337 if (success) 2339 if (success)
2338 return; 2340 return;
2339 } 2341 }
2340 RTC_DCHECK(success) << "Failed to perform mid initial probing (" 2342 EXPECT_TRUE(success) << "Failed to perform mid initial probing ("
2341 << kMaxAttempts << " attempts)."; 2343 << kMaxAttempts << " attempts).";
2342 } 2344 }
2343 2345
2344 // Fails on Linux MSan: bugs.webrtc.org/7428 2346 // Fails on Linux MSan: bugs.webrtc.org/7428
2345 #if defined(MEMORY_SANITIZER) 2347 #if defined(MEMORY_SANITIZER)
2346 TEST_F(EndToEndTest, DISABLED_TriggerMidCallProbing) { 2348 TEST_F(EndToEndTest, DISABLED_TriggerMidCallProbing) {
2347 // Fails on iOS bots: bugs.webrtc.org/7851 2349 // Fails on iOS bots: bugs.webrtc.org/7851
2348 #elif defined(TARGET_IPHONE_SIMULATOR) && TARGET_IPHONE_SIMULATOR 2350 #elif defined(TARGET_IPHONE_SIMULATOR) && TARGET_IPHONE_SIMULATOR
2349 TEST_F(EndToEndTest, DISABLED_TriggerMidCallProbing) { 2351 TEST_F(EndToEndTest, DISABLED_TriggerMidCallProbing) {
2350 #else 2352 #else
2351 TEST_F(EndToEndTest, TriggerMidCallProbing) { 2353 TEST_F(EndToEndTest, TriggerMidCallProbing) {
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
2393 break; 2395 break;
2394 } 2396 }
2395 } while (!observation_complete_.Wait(20)); 2397 } while (!observation_complete_.Wait(20));
2396 } 2398 }
2397 2399
2398 private: 2400 private:
2399 const int kTimeoutMs = 5000; 2401 const int kTimeoutMs = 5000;
2400 bool* const success_; 2402 bool* const success_;
2401 }; 2403 };
2402 2404
2403 bool success; 2405 bool success = false;
eladalon 2017/08/10 15:07:21 This is not strictly necessary, because it happens
2404 const int kMaxAttempts = 3; 2406 const int kMaxAttempts = 3;
2405 for (int i = 0; i < kMaxAttempts; ++i) { 2407 for (int i = 0; i < kMaxAttempts; ++i) {
2406 TriggerMidCallProbingTest test(&success); 2408 TriggerMidCallProbingTest test(&success);
2407 RunBaseTest(&test); 2409 RunBaseTest(&test);
2408 if (success) 2410 if (success)
2409 return; 2411 return;
2410 } 2412 }
2411 RTC_DCHECK(success) << "Failed to perform mid call probing (" << kMaxAttempts 2413 EXPECT_TRUE(success) << "Failed to perform mid call probing (" << kMaxAttempts
2412 << " attempts)."; 2414 << " attempts).";
2413 } 2415 }
2414 2416
2415 TEST_F(EndToEndTest, VerifyNackStats) { 2417 TEST_F(EndToEndTest, VerifyNackStats) {
2416 static const int kPacketNumberToDrop = 200; 2418 static const int kPacketNumberToDrop = 200;
2417 class NackObserver : public test::EndToEndTest { 2419 class NackObserver : public test::EndToEndTest {
2418 public: 2420 public:
2419 NackObserver() 2421 NackObserver()
2420 : EndToEndTest(kLongTimeoutMs), 2422 : EndToEndTest(kLongTimeoutMs),
2421 sent_rtp_packets_(0), 2423 sent_rtp_packets_(0),
2422 dropped_rtp_packet_(0), 2424 dropped_rtp_packet_(0),
(...skipping 2334 matching lines...) Expand 10 before | Expand all | Expand 10 after
4757 std::unique_ptr<VideoEncoder> encoder_; 4759 std::unique_ptr<VideoEncoder> encoder_;
4758 std::unique_ptr<VideoDecoder> decoder_; 4760 std::unique_ptr<VideoDecoder> decoder_;
4759 rtc::CriticalSection crit_; 4761 rtc::CriticalSection crit_;
4760 int recorded_frames_ GUARDED_BY(crit_); 4762 int recorded_frames_ GUARDED_BY(crit_);
4761 } test(this); 4763 } test(this);
4762 4764
4763 RunBaseTest(&test); 4765 RunBaseTest(&test);
4764 } 4766 }
4765 4767
4766 } // namespace webrtc 4768 } // namespace webrtc
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698