OLD | NEW |
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 3489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3500 CreateFrameGeneratorCapturer(); | 3500 CreateFrameGeneratorCapturer(); |
3501 Start(); | 3501 Start(); |
3502 | 3502 |
3503 int64_t start_time_ms = clock_->TimeInMilliseconds(); | 3503 int64_t start_time_ms = clock_->TimeInMilliseconds(); |
3504 while (true) { | 3504 while (true) { |
3505 Call::Stats stats = sender_call_->GetStats(); | 3505 Call::Stats stats = sender_call_->GetStats(); |
3506 ASSERT_GE(start_time_ms + kDefaultTimeoutMs, | 3506 ASSERT_GE(start_time_ms + kDefaultTimeoutMs, |
3507 clock_->TimeInMilliseconds()) | 3507 clock_->TimeInMilliseconds()) |
3508 << "No RTT stats before timeout!"; | 3508 << "No RTT stats before timeout!"; |
3509 if (stats.rtt_ms != -1) { | 3509 if (stats.rtt_ms != -1) { |
3510 EXPECT_GE(stats.rtt_ms, kSendDelayMs + kReceiveDelayMs); | 3510 // To avoid failures caused by rounding or minor ntp clock adjustments, |
| 3511 // relax expectation by 1ms. |
| 3512 constexpr int kAllowedErrorMs = 1; |
| 3513 EXPECT_GE(stats.rtt_ms, kSendDelayMs + kReceiveDelayMs - kAllowedErrorMs); |
3511 break; | 3514 break; |
3512 } | 3515 } |
3513 SleepMs(10); | 3516 SleepMs(10); |
3514 } | 3517 } |
3515 | 3518 |
3516 Stop(); | 3519 Stop(); |
3517 DestroyStreams(); | 3520 DestroyStreams(); |
3518 } | 3521 } |
3519 | 3522 |
3520 void EndToEndTest::VerifyNewVideoSendStreamsRespectNetworkState( | 3523 void EndToEndTest::VerifyNewVideoSendStreamsRespectNetworkState( |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3734 private: | 3737 private: |
3735 bool video_observed_; | 3738 bool video_observed_; |
3736 bool audio_observed_; | 3739 bool audio_observed_; |
3737 SequenceNumberUnwrapper unwrapper_; | 3740 SequenceNumberUnwrapper unwrapper_; |
3738 std::set<int64_t> received_packet_ids_; | 3741 std::set<int64_t> received_packet_ids_; |
3739 } test; | 3742 } test; |
3740 | 3743 |
3741 RunBaseTest(&test); | 3744 RunBaseTest(&test); |
3742 } | 3745 } |
3743 } // namespace webrtc | 3746 } // namespace webrtc |
OLD | NEW |