| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 EXPECT_TRUE(map.Register<TransmissionOffset>(3)); | 80 EXPECT_TRUE(map.Register<TransmissionOffset>(3)); |
| 81 | 81 |
| 82 EXPECT_FALSE(map.Register<AudioLevel>(3)); | 82 EXPECT_FALSE(map.Register<AudioLevel>(3)); |
| 83 EXPECT_TRUE(map.Register<AudioLevel>(4)); | 83 EXPECT_TRUE(map.Register<AudioLevel>(4)); |
| 84 } | 84 } |
| 85 | 85 |
| 86 TEST(RtpHeaderExtensionTest, GetTotalLength) { | 86 TEST(RtpHeaderExtensionTest, GetTotalLength) { |
| 87 RtpHeaderExtensionMap map; | 87 RtpHeaderExtensionMap map; |
| 88 EXPECT_EQ(0u, map.GetTotalLengthInBytes()); | 88 EXPECT_EQ(0u, map.GetTotalLengthInBytes()); |
| 89 EXPECT_TRUE(map.Register<TransmissionOffset>(3)); | 89 EXPECT_TRUE(map.Register<TransmissionOffset>(3)); |
| 90 static constexpr size_t kRtpOneByteHeaderLength = 4; |
| 90 EXPECT_EQ(kRtpOneByteHeaderLength + (TransmissionOffset::kValueSizeBytes + 1), | 91 EXPECT_EQ(kRtpOneByteHeaderLength + (TransmissionOffset::kValueSizeBytes + 1), |
| 91 map.GetTotalLengthInBytes()); | 92 map.GetTotalLengthInBytes()); |
| 92 } | 93 } |
| 93 | 94 |
| 94 TEST(RtpHeaderExtensionTest, GetType) { | 95 TEST(RtpHeaderExtensionTest, GetType) { |
| 95 RtpHeaderExtensionMap map; | 96 RtpHeaderExtensionMap map; |
| 96 EXPECT_EQ(RtpHeaderExtensionMap::kInvalidType, map.GetType(3)); | 97 EXPECT_EQ(RtpHeaderExtensionMap::kInvalidType, map.GetType(3)); |
| 97 EXPECT_TRUE(map.Register<TransmissionOffset>(3)); | 98 EXPECT_TRUE(map.Register<TransmissionOffset>(3)); |
| 98 | 99 |
| 99 EXPECT_EQ(TransmissionOffset::kId, map.GetType(3)); | 100 EXPECT_EQ(TransmissionOffset::kId, map.GetType(3)); |
| 100 } | 101 } |
| 101 | 102 |
| 102 TEST(RtpHeaderExtensionTest, GetId) { | 103 TEST(RtpHeaderExtensionTest, GetId) { |
| 103 RtpHeaderExtensionMap map; | 104 RtpHeaderExtensionMap map; |
| 104 EXPECT_EQ(RtpHeaderExtensionMap::kInvalidId, | 105 EXPECT_EQ(RtpHeaderExtensionMap::kInvalidId, |
| 105 map.GetId(TransmissionOffset::kId)); | 106 map.GetId(TransmissionOffset::kId)); |
| 106 EXPECT_TRUE(map.Register<TransmissionOffset>(3)); | 107 EXPECT_TRUE(map.Register<TransmissionOffset>(3)); |
| 107 | 108 |
| 108 EXPECT_EQ(3, map.GetId(TransmissionOffset::kId)); | 109 EXPECT_EQ(3, map.GetId(TransmissionOffset::kId)); |
| 109 } | 110 } |
| 110 | 111 |
| 111 } // namespace webrtc | 112 } // namespace webrtc |
| OLD | NEW |