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

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

Issue 2728103002: Fix flaky EndToEndTest.TransportSeqNumOnAudioAndVideo (Closed)
Patch Set: Created 3 years, 9 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 4045 matching lines...) Expand 10 before | Expand all | Expand 10 after
4056 // Unwrap packet id and verify uniqueness. 4056 // Unwrap packet id and verify uniqueness.
4057 int64_t packet_id = 4057 int64_t packet_id =
4058 unwrapper_.Unwrap(header.extension.transportSequenceNumber); 4058 unwrapper_.Unwrap(header.extension.transportSequenceNumber);
4059 EXPECT_TRUE(received_packet_ids_.insert(packet_id).second); 4059 EXPECT_TRUE(received_packet_ids_.insert(packet_id).second);
4060 4060
4061 if (header.ssrc == kVideoSendSsrcs[0]) 4061 if (header.ssrc == kVideoSendSsrcs[0])
4062 video_observed_ = true; 4062 video_observed_ = true;
4063 if (header.ssrc == kAudioSendSsrc) 4063 if (header.ssrc == kAudioSendSsrc)
4064 audio_observed_ = true; 4064 audio_observed_ = true;
4065 if (audio_observed_ && video_observed_ && 4065 if (audio_observed_ && video_observed_ &&
4066 received_packet_ids_.size() == 50) { 4066 received_packet_ids_.size() >= 50) {
åsapersson 2017/03/03 11:16:19 maybe add a constant for 50
danilchap 2017/03/03 12:14:11 Done.
4067 size_t packet_id_range = 4067 size_t packet_id_range =
4068 *received_packet_ids_.rbegin() - *received_packet_ids_.begin() + 1; 4068 *received_packet_ids_.rbegin() - *received_packet_ids_.begin() + 1;
4069 EXPECT_EQ(received_packet_ids_.size(), packet_id_range); 4069 EXPECT_EQ(received_packet_ids_.size(), packet_id_range);
4070 observation_complete_.Set(); 4070 observation_complete_.Set();
4071 } 4071 }
4072 return SEND_PACKET; 4072 return SEND_PACKET;
4073 } 4073 }
4074 4074
4075 void PerformTest() override { 4075 void PerformTest() override {
4076 EXPECT_TRUE(Wait()) << "Timed out while waiting for audio and video " 4076 EXPECT_TRUE(Wait()) << "Timed out while waiting for audio and video "
4077 "packets with transport sequence number."; 4077 "packets with transport sequence number.";
4078 // Double check conditions for successfull test to produce better error
4079 // message when this test fail.
4080 EXPECT_TRUE(video_observed_);
4081 EXPECT_TRUE(audio_observed_);
4082 EXPECT_GE(received_packet_ids_.size(), 50u);
4078 } 4083 }
4079 4084
4080 private: 4085 private:
4081 bool video_observed_; 4086 bool video_observed_;
4082 bool audio_observed_; 4087 bool audio_observed_;
4083 SequenceNumberUnwrapper unwrapper_; 4088 SequenceNumberUnwrapper unwrapper_;
4084 std::set<int64_t> received_packet_ids_; 4089 std::set<int64_t> received_packet_ids_;
4085 } test; 4090 } test;
4086 4091
4087 RunBaseTest(&test); 4092 RunBaseTest(&test);
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
4181 std::unique_ptr<VideoEncoder> encoder_; 4186 std::unique_ptr<VideoEncoder> encoder_;
4182 std::unique_ptr<VideoDecoder> decoder_; 4187 std::unique_ptr<VideoDecoder> decoder_;
4183 rtc::CriticalSection crit_; 4188 rtc::CriticalSection crit_;
4184 int recorded_frames_ GUARDED_BY(crit_); 4189 int recorded_frames_ GUARDED_BY(crit_);
4185 } test(this); 4190 } test(this);
4186 4191
4187 RunBaseTest(&test); 4192 RunBaseTest(&test);
4188 } 4193 }
4189 4194
4190 } // namespace webrtc 4195 } // 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