OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2015 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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 const int kStatsRequestIntervalMs = 1000; | 72 const int kStatsRequestIntervalMs = 1000; |
73 const int kStatsBufferSize = 3; | 73 const int kStatsBufferSize = 3; |
74 | 74 |
75 uint32_t deadline = rtc::TimeAfter(kMaxRunTimeMs); | 75 uint32_t deadline = rtc::TimeAfter(kMaxRunTimeMs); |
76 // Run the following up to |kMaxRunTimeMs| milliseconds. | 76 // Run the following up to |kMaxRunTimeMs| milliseconds. |
77 int successive_pass = 0; | 77 int successive_pass = 0; |
78 webrtc::CallStatistics stats_1; | 78 webrtc::CallStatistics stats_1; |
79 webrtc::CallStatistics stats_2; | 79 webrtc::CallStatistics stats_2; |
80 std::queue<Stats> stats_buffer; | 80 std::queue<Stats> stats_buffer; |
81 | 81 |
82 while (rtc::TimeIsLater(rtc::Time(), deadline) && | 82 while (rtc::Time() < deadline && successive_pass < kNeedSuccessivePass) { |
83 successive_pass < kNeedSuccessivePass) { | |
84 webrtc::SleepMs(kStatsRequestIntervalMs); | 83 webrtc::SleepMs(kStatsRequestIntervalMs); |
85 | 84 |
86 EXPECT_TRUE(trans.GetReceiverStatistics(id_1, &stats_1)); | 85 EXPECT_TRUE(trans.GetReceiverStatistics(id_1, &stats_1)); |
87 EXPECT_TRUE(trans.GetReceiverStatistics(id_2, &stats_2)); | 86 EXPECT_TRUE(trans.GetReceiverStatistics(id_2, &stats_2)); |
88 | 87 |
89 // It is not easy to verify the NTP time directly. We verify it by testing | 88 // It is not easy to verify the NTP time directly. We verify it by testing |
90 // the difference of two start NTP times. | 89 // the difference of two start NTP times. |
91 int64_t captured_start_ntp_delay = stats_2.capture_start_ntp_time_ms_ - | 90 int64_t captured_start_ntp_delay = stats_2.capture_start_ntp_time_ms_ - |
92 stats_1.capture_start_ntp_time_ms_; | 91 stats_1.capture_start_ntp_time_ms_; |
93 | 92 |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 // depends on the sleep timer. So we allow a small off from |kPackets|. | 166 // depends on the sleep timer. So we allow a small off from |kPackets|. |
168 EXPECT_NEAR(stats_1.packetsReceived, kPackets, 2); | 167 EXPECT_NEAR(stats_1.packetsReceived, kPackets, 2); |
169 EXPECT_NEAR(stats_2.packetsReceived, kPackets, 2); | 168 EXPECT_NEAR(stats_2.packetsReceived, kPackets, 2); |
170 EXPECT_NEAR(stats_3.packetsReceived, kPackets, 2); | 169 EXPECT_NEAR(stats_3.packetsReceived, kPackets, 2); |
171 } | 170 } |
172 | 171 |
173 remove(silence_file.c_str()); | 172 remove(silence_file.c_str()); |
174 } | 173 } |
175 | 174 |
176 } // namespace voetest | 175 } // namespace voetest |
OLD | NEW |