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

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

Issue 2818723002: Make EndToEndTest.ContentTypeSwitches more robust by sending more frames before test ends (Closed)
Patch Set: Created 3 years, 8 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 2702 matching lines...) Expand 10 before | Expand all | Expand 10 after
2713 } 2713 }
2714 } 2714 }
2715 2715
2716 Action OnSendRtp(const uint8_t* packet, size_t length) override { 2716 Action OnSendRtp(const uint8_t* packet, size_t length) override {
2717 if (MinNumberOfFramesReceived()) 2717 if (MinNumberOfFramesReceived())
2718 observation_complete_.Set(); 2718 observation_complete_.Set();
2719 return SEND_PACKET; 2719 return SEND_PACKET;
2720 } 2720 }
2721 2721
2722 bool MinNumberOfFramesReceived() const { 2722 bool MinNumberOfFramesReceived() const {
2723 const int kMinRequiredHistogramSamples = 200; 2723 // Have some room for frames with wrong content type during switch.
2724 const int kMinRequiredHistogramSamples = 200+50;
2724 rtc::CritScope lock(&crit_); 2725 rtc::CritScope lock(&crit_);
2725 return num_frames_received_ > kMinRequiredHistogramSamples; 2726 return num_frames_received_ > kMinRequiredHistogramSamples;
2726 } 2727 }
2727 2728
2728 // May be called several times. 2729 // May be called several times.
2729 void PerformTest() override { 2730 void PerformTest() override {
2730 EXPECT_TRUE(Wait()) << "Timed out waiting for enough packets."; 2731 EXPECT_TRUE(Wait()) << "Timed out waiting for enough packets.";
2731 // Reset frame counter so next PerformTest() call will do something. 2732 // Reset frame counter so next PerformTest() call will do something.
2732 { 2733 {
2733 rtc::CritScope lock(&crit_); 2734 rtc::CritScope lock(&crit_);
(...skipping 1729 matching lines...) Expand 10 before | Expand all | Expand 10 after
4463 std::unique_ptr<VideoEncoder> encoder_; 4464 std::unique_ptr<VideoEncoder> encoder_;
4464 std::unique_ptr<VideoDecoder> decoder_; 4465 std::unique_ptr<VideoDecoder> decoder_;
4465 rtc::CriticalSection crit_; 4466 rtc::CriticalSection crit_;
4466 int recorded_frames_ GUARDED_BY(crit_); 4467 int recorded_frames_ GUARDED_BY(crit_);
4467 } test(this); 4468 } test(this);
4468 4469
4469 RunBaseTest(&test); 4470 RunBaseTest(&test);
4470 } 4471 }
4471 4472
4472 } // namespace webrtc 4473 } // 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