| 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 | 10 |
| 11 #include <memory> |
| 12 |
| 11 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
| 12 | 14 |
| 13 #include "webrtc/base/scoped_ptr.h" | |
| 14 #include "webrtc/common_types.h" | 15 #include "webrtc/common_types.h" |
| 15 #include "webrtc/modules/remote_bitrate_estimator/inter_arrival.h" | 16 #include "webrtc/modules/remote_bitrate_estimator/inter_arrival.h" |
| 16 | 17 |
| 17 namespace webrtc { | 18 namespace webrtc { |
| 18 namespace testing { | 19 namespace testing { |
| 19 | 20 |
| 20 enum { | 21 enum { |
| 21 kTimestampGroupLengthUs = 5000, | 22 kTimestampGroupLengthUs = 5000, |
| 22 kMinStep = 20, | 23 kMinStep = 20, |
| 23 kTriggerNewGroupUs = kTimestampGroupLengthUs + kMinStep, | 24 kTriggerNewGroupUs = kTimestampGroupLengthUs + kMinStep, |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 packet_size, | 193 packet_size, |
| 193 &delta_timestamp, | 194 &delta_timestamp, |
| 194 &delta_arrival_time_ms, | 195 &delta_arrival_time_ms, |
| 195 &delta_packet_size); | 196 &delta_packet_size); |
| 196 EXPECT_EQ(true, computed); | 197 EXPECT_EQ(true, computed); |
| 197 EXPECT_NEAR(expected_timestamp_delta, delta_timestamp, timestamp_near); | 198 EXPECT_NEAR(expected_timestamp_delta, delta_timestamp, timestamp_near); |
| 198 EXPECT_EQ(expected_arrival_time_delta_ms, delta_arrival_time_ms); | 199 EXPECT_EQ(expected_arrival_time_delta_ms, delta_arrival_time_ms); |
| 199 EXPECT_EQ(expected_packet_size_delta, delta_packet_size); | 200 EXPECT_EQ(expected_packet_size_delta, delta_packet_size); |
| 200 } | 201 } |
| 201 | 202 |
| 202 rtc::scoped_ptr<InterArrival> inter_arrival_rtp_; | 203 std::unique_ptr<InterArrival> inter_arrival_rtp_; |
| 203 rtc::scoped_ptr<InterArrival> inter_arrival_ast_; | 204 std::unique_ptr<InterArrival> inter_arrival_ast_; |
| 204 }; | 205 }; |
| 205 | 206 |
| 206 TEST_F(InterArrivalTest, FirstPacket) { | 207 TEST_F(InterArrivalTest, FirstPacket) { |
| 207 ExpectFalse(0, 17, 1); | 208 ExpectFalse(0, 17, 1); |
| 208 } | 209 } |
| 209 | 210 |
| 210 TEST_F(InterArrivalTest, FirstGroup) { | 211 TEST_F(InterArrivalTest, FirstGroup) { |
| 211 // G1 | 212 // G1 |
| 212 int64_t arrival_time = 17; | 213 int64_t arrival_time = 17; |
| 213 int64_t g1_arrival_time = arrival_time; | 214 int64_t g1_arrival_time = arrival_time; |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 413 | 414 |
| 414 TEST_F(InterArrivalTest, RtpTimestampWrapOutOfOrderWithinGroup) { | 415 TEST_F(InterArrivalTest, RtpTimestampWrapOutOfOrderWithinGroup) { |
| 415 WrapTestHelper(kStartRtpTimestampWrapUs, 1, true); | 416 WrapTestHelper(kStartRtpTimestampWrapUs, 1, true); |
| 416 } | 417 } |
| 417 | 418 |
| 418 TEST_F(InterArrivalTest, AbsSendTimeWrapOutOfOrderWithinGroup) { | 419 TEST_F(InterArrivalTest, AbsSendTimeWrapOutOfOrderWithinGroup) { |
| 419 WrapTestHelper(kStartAbsSendTimeWrapUs, 1, true); | 420 WrapTestHelper(kStartAbsSendTimeWrapUs, 1, true); |
| 420 } | 421 } |
| 421 } // namespace testing | 422 } // namespace testing |
| 422 } // namespace webrtc | 423 } // namespace webrtc |
| OLD | NEW |