| OLD | NEW |
| 1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/browser/renderer_host/p2p/socket_host.h" | 5 #include "content/browser/renderer_host/p2p/socket_host.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "content/browser/renderer_host/p2p/socket_host_test_utils.h" | 10 #include "content/browser/renderer_host/p2p/socket_host_test_utils.h" |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 0x32, 0xaa, 0xbb, 0xcc, | 145 0x32, 0xaa, 0xbb, 0xcc, |
| 146 }; | 146 }; |
| 147 | 147 |
| 148 // Index of AbsSendTimeExtn data in message |kRtpMsgWithAbsSendTimeExtension|. | 148 // Index of AbsSendTimeExtn data in message |kRtpMsgWithAbsSendTimeExtension|. |
| 149 static const int kAstIndexInRtpMsg = 21; | 149 static const int kAstIndexInRtpMsg = 21; |
| 150 | 150 |
| 151 namespace content { | 151 namespace content { |
| 152 | 152 |
| 153 // This test verifies parsing of all invalid raw packets. | 153 // This test verifies parsing of all invalid raw packets. |
| 154 TEST(P2PSocketHostTest, TestInvalidRawRtpMessages) { | 154 TEST(P2PSocketHostTest, TestInvalidRawRtpMessages) { |
| 155 int start_pos = INT_MAX, rtp_length = INT_MAX; | 155 size_t start_pos = SIZE_MAX, rtp_length = SIZE_MAX; |
| 156 EXPECT_FALSE(packet_processing_helpers::GetRtpPacketStartPositionAndLength( | 156 EXPECT_FALSE(packet_processing_helpers::GetRtpPacketStartPositionAndLength( |
| 157 reinterpret_cast<char*>(kRtpMsgWithInvalidLength), | 157 reinterpret_cast<char*>(kRtpMsgWithInvalidLength), |
| 158 sizeof(kRtpMsgWithInvalidLength), | 158 sizeof(kRtpMsgWithInvalidLength), |
| 159 &start_pos, &rtp_length)); | 159 &start_pos, &rtp_length)); |
| 160 EXPECT_EQ(INT_MAX, start_pos); | 160 EXPECT_EQ(SIZE_MAX, start_pos); |
| 161 EXPECT_EQ(INT_MAX, rtp_length); | 161 EXPECT_EQ(SIZE_MAX, rtp_length); |
| 162 | 162 |
| 163 EXPECT_FALSE(packet_processing_helpers::GetRtpPacketStartPositionAndLength( | 163 EXPECT_FALSE(packet_processing_helpers::GetRtpPacketStartPositionAndLength( |
| 164 reinterpret_cast<char*>(kRtpMsgWithInvalidExtnLength), | 164 reinterpret_cast<char*>(kRtpMsgWithInvalidExtnLength), |
| 165 sizeof(kRtpMsgWithInvalidExtnLength), | 165 sizeof(kRtpMsgWithInvalidExtnLength), |
| 166 &start_pos, &rtp_length)); | 166 &start_pos, &rtp_length)); |
| 167 EXPECT_EQ(INT_MAX, start_pos); | 167 EXPECT_EQ(SIZE_MAX, start_pos); |
| 168 EXPECT_EQ(INT_MAX, rtp_length); | 168 EXPECT_EQ(SIZE_MAX, rtp_length); |
| 169 } | 169 } |
| 170 | 170 |
| 171 // Verify invalid TURN send indication messages. Messages are proper STUN | 171 // Verify invalid TURN send indication messages. Messages are proper STUN |
| 172 // messages with incorrect values in attributes. | 172 // messages with incorrect values in attributes. |
| 173 TEST(P2PSocketHostTest, TestInvalidTurnSendIndicationMessages) { | 173 TEST(P2PSocketHostTest, TestInvalidTurnSendIndicationMessages) { |
| 174 // Initializing out params to very large value. | 174 // Initializing out params to very large value. |
| 175 int start_pos = INT_MAX, rtp_length = INT_MAX; | 175 size_t start_pos = SIZE_MAX, rtp_length = SIZE_MAX; |
| 176 EXPECT_FALSE(packet_processing_helpers::GetRtpPacketStartPositionAndLength( | 176 EXPECT_FALSE(packet_processing_helpers::GetRtpPacketStartPositionAndLength( |
| 177 reinterpret_cast<char*>(kTurnSendIndicationMsgWithNoAttributes), | 177 reinterpret_cast<char*>(kTurnSendIndicationMsgWithNoAttributes), |
| 178 sizeof(kTurnSendIndicationMsgWithNoAttributes), | 178 sizeof(kTurnSendIndicationMsgWithNoAttributes), |
| 179 &start_pos, &rtp_length)); | 179 &start_pos, &rtp_length)); |
| 180 EXPECT_EQ(INT_MAX, start_pos); | 180 EXPECT_EQ(SIZE_MAX, start_pos); |
| 181 EXPECT_EQ(INT_MAX, rtp_length); | 181 EXPECT_EQ(SIZE_MAX, rtp_length); |
| 182 | 182 |
| 183 EXPECT_FALSE(packet_processing_helpers::GetRtpPacketStartPositionAndLength( | 183 EXPECT_FALSE(packet_processing_helpers::GetRtpPacketStartPositionAndLength( |
| 184 reinterpret_cast<char*>(kTurnSendIndicationMsgWithInvalidLength), | 184 reinterpret_cast<char*>(kTurnSendIndicationMsgWithInvalidLength), |
| 185 sizeof(kTurnSendIndicationMsgWithInvalidLength), | 185 sizeof(kTurnSendIndicationMsgWithInvalidLength), |
| 186 &start_pos, &rtp_length)); | 186 &start_pos, &rtp_length)); |
| 187 EXPECT_EQ(INT_MAX, start_pos); | 187 EXPECT_EQ(SIZE_MAX, start_pos); |
| 188 EXPECT_EQ(INT_MAX, rtp_length); | 188 EXPECT_EQ(SIZE_MAX, rtp_length); |
| 189 | 189 |
| 190 EXPECT_FALSE(packet_processing_helpers::GetRtpPacketStartPositionAndLength( | 190 EXPECT_FALSE(packet_processing_helpers::GetRtpPacketStartPositionAndLength( |
| 191 reinterpret_cast<char*>(kTurnSendIndicatinMsgWithNoDataAttribute), | 191 reinterpret_cast<char*>(kTurnSendIndicatinMsgWithNoDataAttribute), |
| 192 sizeof(kTurnSendIndicatinMsgWithNoDataAttribute), | 192 sizeof(kTurnSendIndicatinMsgWithNoDataAttribute), |
| 193 &start_pos, &rtp_length)); | 193 &start_pos, &rtp_length)); |
| 194 EXPECT_EQ(INT_MAX, start_pos); | 194 EXPECT_EQ(SIZE_MAX, start_pos); |
| 195 EXPECT_EQ(INT_MAX, rtp_length); | 195 EXPECT_EQ(SIZE_MAX, rtp_length); |
| 196 } | 196 } |
| 197 | 197 |
| 198 // This test verifies incorrectly formed TURN channel messages. | 198 // This test verifies incorrectly formed TURN channel messages. |
| 199 TEST(P2PSocketHostTest, TestInvalidTurnChannelMessages) { | 199 TEST(P2PSocketHostTest, TestInvalidTurnChannelMessages) { |
| 200 int start_pos = INT_MAX, rtp_length = INT_MAX; | 200 size_t start_pos = SIZE_MAX, rtp_length = SIZE_MAX; |
| 201 EXPECT_FALSE(packet_processing_helpers::GetRtpPacketStartPositionAndLength( | 201 EXPECT_FALSE(packet_processing_helpers::GetRtpPacketStartPositionAndLength( |
| 202 reinterpret_cast<char*>(kTurnChannelMsgNoRtpPacket), | 202 reinterpret_cast<char*>(kTurnChannelMsgNoRtpPacket), |
| 203 sizeof(kTurnChannelMsgNoRtpPacket), | 203 sizeof(kTurnChannelMsgNoRtpPacket), |
| 204 &start_pos, &rtp_length)); | 204 &start_pos, &rtp_length)); |
| 205 EXPECT_EQ(INT_MAX, start_pos); | 205 EXPECT_EQ(SIZE_MAX, start_pos); |
| 206 EXPECT_EQ(INT_MAX, rtp_length); | 206 EXPECT_EQ(SIZE_MAX, rtp_length); |
| 207 | 207 |
| 208 EXPECT_FALSE(packet_processing_helpers::GetRtpPacketStartPositionAndLength( | 208 EXPECT_FALSE(packet_processing_helpers::GetRtpPacketStartPositionAndLength( |
| 209 reinterpret_cast<char*>(kTurnChannelMsgWithZeroLength), | 209 reinterpret_cast<char*>(kTurnChannelMsgWithZeroLength), |
| 210 sizeof(kTurnChannelMsgWithZeroLength), | 210 sizeof(kTurnChannelMsgWithZeroLength), |
| 211 &start_pos, &rtp_length)); | 211 &start_pos, &rtp_length)); |
| 212 EXPECT_EQ(INT_MAX, start_pos); | 212 EXPECT_EQ(SIZE_MAX, start_pos); |
| 213 EXPECT_EQ(INT_MAX, rtp_length); | 213 EXPECT_EQ(SIZE_MAX, rtp_length); |
| 214 } | 214 } |
| 215 | 215 |
| 216 // This test verifies parsing of a valid RTP packet which has 2byte header | 216 // This test verifies parsing of a valid RTP packet which has 2byte header |
| 217 // extension instead of a 1 byte header extension. | 217 // extension instead of a 1 byte header extension. |
| 218 TEST(P2PSocketHostTest, TestValid2ByteExtnHdrRtpMessage) { | 218 TEST(P2PSocketHostTest, TestValid2ByteExtnHdrRtpMessage) { |
| 219 int start_pos = INT_MAX, rtp_length = INT_MAX; | 219 size_t start_pos = SIZE_MAX, rtp_length = SIZE_MAX; |
| 220 EXPECT_TRUE(packet_processing_helpers::GetRtpPacketStartPositionAndLength( | 220 EXPECT_TRUE(packet_processing_helpers::GetRtpPacketStartPositionAndLength( |
| 221 reinterpret_cast<char*>(kRtpMsgWith2ByteExtnHeader), | 221 reinterpret_cast<char*>(kRtpMsgWith2ByteExtnHeader), |
| 222 sizeof(kRtpMsgWith2ByteExtnHeader), | 222 sizeof(kRtpMsgWith2ByteExtnHeader), |
| 223 &start_pos, &rtp_length)); | 223 &start_pos, &rtp_length)); |
| 224 EXPECT_EQ(20, rtp_length); | 224 EXPECT_EQ(20U, rtp_length); |
| 225 EXPECT_EQ(0, start_pos); | 225 EXPECT_EQ(0U, start_pos); |
| 226 } | 226 } |
| 227 | 227 |
| 228 // This test verifies parsing of a valid RTP packet which has 1 byte header | 228 // This test verifies parsing of a valid RTP packet which has 1 byte header |
| 229 // AbsSendTime extension in it. | 229 // AbsSendTime extension in it. |
| 230 TEST(P2PSocketHostTest, TestValidRtpPacketWithAbsSendTimeExtension) { | 230 TEST(P2PSocketHostTest, TestValidRtpPacketWithAbsSendTimeExtension) { |
| 231 int start_pos = INT_MAX, rtp_length = INT_MAX; | 231 size_t start_pos = SIZE_MAX, rtp_length = SIZE_MAX; |
| 232 EXPECT_TRUE(packet_processing_helpers::GetRtpPacketStartPositionAndLength( | 232 EXPECT_TRUE(packet_processing_helpers::GetRtpPacketStartPositionAndLength( |
| 233 reinterpret_cast<char*>(kRtpMsgWithAbsSendTimeExtension), | 233 reinterpret_cast<char*>(kRtpMsgWithAbsSendTimeExtension), |
| 234 sizeof(kRtpMsgWithAbsSendTimeExtension), | 234 sizeof(kRtpMsgWithAbsSendTimeExtension), |
| 235 &start_pos, &rtp_length)); | 235 &start_pos, &rtp_length)); |
| 236 EXPECT_EQ(24, rtp_length); | 236 EXPECT_EQ(24U, rtp_length); |
| 237 EXPECT_EQ(0, start_pos); | 237 EXPECT_EQ(0U, start_pos); |
| 238 } | 238 } |
| 239 | 239 |
| 240 // This test verifies parsing of a valid TURN Send Indication messages. | 240 // This test verifies parsing of a valid TURN Send Indication messages. |
| 241 TEST(P2PSocketHostTest, TestValidTurnSendIndicationMessages) { | 241 TEST(P2PSocketHostTest, TestValidTurnSendIndicationMessages) { |
| 242 int start_pos = INT_MAX, rtp_length = INT_MAX; | 242 size_t start_pos = SIZE_MAX, rtp_length = SIZE_MAX; |
| 243 EXPECT_TRUE(packet_processing_helpers::GetRtpPacketStartPositionAndLength( | 243 EXPECT_TRUE(packet_processing_helpers::GetRtpPacketStartPositionAndLength( |
| 244 reinterpret_cast<char*>(kTurnSendIndicationMsgWithoutRtpExtension), | 244 reinterpret_cast<char*>(kTurnSendIndicationMsgWithoutRtpExtension), |
| 245 sizeof(kTurnSendIndicationMsgWithoutRtpExtension), | 245 sizeof(kTurnSendIndicationMsgWithoutRtpExtension), |
| 246 &start_pos, &rtp_length)); | 246 &start_pos, &rtp_length)); |
| 247 EXPECT_EQ(12, rtp_length); | 247 EXPECT_EQ(12U, rtp_length); |
| 248 EXPECT_EQ(32, start_pos); | 248 EXPECT_EQ(32U, start_pos); |
| 249 | 249 |
| 250 start_pos = INT_MAX, rtp_length = INT_MAX; | 250 start_pos = SIZE_MAX, rtp_length = SIZE_MAX; |
| 251 EXPECT_TRUE(packet_processing_helpers::GetRtpPacketStartPositionAndLength( | 251 EXPECT_TRUE(packet_processing_helpers::GetRtpPacketStartPositionAndLength( |
| 252 reinterpret_cast<char*>(kTurnSendIndicationMsgWithAbsSendTimeExtension), | 252 reinterpret_cast<char*>(kTurnSendIndicationMsgWithAbsSendTimeExtension), |
| 253 sizeof(kTurnSendIndicationMsgWithAbsSendTimeExtension), | 253 sizeof(kTurnSendIndicationMsgWithAbsSendTimeExtension), |
| 254 &start_pos, &rtp_length)); | 254 &start_pos, &rtp_length)); |
| 255 EXPECT_EQ(24, rtp_length); | 255 EXPECT_EQ(24U, rtp_length); |
| 256 EXPECT_EQ(32, start_pos); | 256 EXPECT_EQ(32U, start_pos); |
| 257 } | 257 } |
| 258 | 258 |
| 259 // This test verifies parsing of valid TURN Channel Messages. | 259 // This test verifies parsing of valid TURN Channel Messages. |
| 260 TEST(P2PSocketHostTest, TestValidTurnChannelMessages) { | 260 TEST(P2PSocketHostTest, TestValidTurnChannelMessages) { |
| 261 int start_pos = -1, rtp_length = -1; | 261 size_t start_pos = 0, rtp_length = 0; |
| 262 EXPECT_TRUE(packet_processing_helpers::GetRtpPacketStartPositionAndLength( | 262 EXPECT_TRUE(packet_processing_helpers::GetRtpPacketStartPositionAndLength( |
| 263 reinterpret_cast<char*>(kTurnChannelMsgWithRtpPacket), | 263 reinterpret_cast<char*>(kTurnChannelMsgWithRtpPacket), |
| 264 sizeof(kTurnChannelMsgWithRtpPacket), &start_pos, &rtp_length)); | 264 sizeof(kTurnChannelMsgWithRtpPacket), &start_pos, &rtp_length)); |
| 265 EXPECT_EQ(12, rtp_length); | 265 EXPECT_EQ(12U, rtp_length); |
| 266 EXPECT_EQ(4, start_pos); | 266 EXPECT_EQ(4U, start_pos); |
| 267 | 267 |
| 268 start_pos = -1, rtp_length = -1; | 268 start_pos = 0, rtp_length = 0; |
| 269 EXPECT_TRUE(packet_processing_helpers::GetRtpPacketStartPositionAndLength( | 269 EXPECT_TRUE(packet_processing_helpers::GetRtpPacketStartPositionAndLength( |
| 270 reinterpret_cast<char*>(kTurnChannelMsgWithAbsSendTimeExtension), | 270 reinterpret_cast<char*>(kTurnChannelMsgWithAbsSendTimeExtension), |
| 271 sizeof(kTurnChannelMsgWithAbsSendTimeExtension), | 271 sizeof(kTurnChannelMsgWithAbsSendTimeExtension), |
| 272 &start_pos, &rtp_length)); | 272 &start_pos, &rtp_length)); |
| 273 EXPECT_EQ(20, rtp_length); | 273 EXPECT_EQ(20U, rtp_length); |
| 274 EXPECT_EQ(4, start_pos); | 274 EXPECT_EQ(4U, start_pos); |
| 275 } | 275 } |
| 276 | 276 |
| 277 // Verify handling of a 2 byte extension header RTP messsage. Currently we don't | 277 // Verify handling of a 2 byte extension header RTP messsage. Currently we don't |
| 278 // handle this kind of message. | 278 // handle this kind of message. |
| 279 TEST(P2PSocketHostTest, TestUpdateAbsSendTimeExtensionIn2ByteHeaderExtn) { | 279 TEST(P2PSocketHostTest, TestUpdateAbsSendTimeExtensionIn2ByteHeaderExtn) { |
| 280 EXPECT_FALSE(packet_processing_helpers::UpdateRtpAbsSendTimeExtn( | 280 EXPECT_FALSE(packet_processing_helpers::UpdateRtpAbsSendTimeExtension( |
| 281 reinterpret_cast<char*>(kRtpMsgWith2ByteExtnHeader), | 281 reinterpret_cast<char*>(kRtpMsgWith2ByteExtnHeader), |
| 282 sizeof(kRtpMsgWith2ByteExtnHeader), 3, 0)); | 282 sizeof(kRtpMsgWith2ByteExtnHeader), |
| 283 3, |
| 284 0)); |
| 283 } | 285 } |
| 284 | 286 |
| 285 // Verify finding an extension ID in the TURN send indication message. | 287 // Verify finding an extension ID in the TURN send indication message. |
| 286 TEST(P2PSocketHostTest, TestUpdateAbsSendTimeExtensionInTurnSendIndication) { | 288 TEST(P2PSocketHostTest, TestUpdateAbsSendTimeExtensionInTurnSendIndication) { |
| 287 EXPECT_TRUE(packet_processing_helpers::UpdateRtpAbsSendTimeExtn( | 289 EXPECT_TRUE(packet_processing_helpers::UpdateRtpAbsSendTimeExtension( |
| 288 reinterpret_cast<char*>(kTurnSendIndicationMsgWithoutRtpExtension), | 290 reinterpret_cast<char*>(kTurnSendIndicationMsgWithoutRtpExtension), |
| 289 sizeof(kTurnSendIndicationMsgWithoutRtpExtension), 3, 0)); | 291 sizeof(kTurnSendIndicationMsgWithoutRtpExtension), |
| 292 3, |
| 293 0)); |
| 290 | 294 |
| 291 EXPECT_TRUE(packet_processing_helpers::UpdateRtpAbsSendTimeExtn( | 295 EXPECT_TRUE(packet_processing_helpers::UpdateRtpAbsSendTimeExtension( |
| 292 reinterpret_cast<char*>(kTurnSendIndicationMsgWithAbsSendTimeExtension), | 296 reinterpret_cast<char*>(kTurnSendIndicationMsgWithAbsSendTimeExtension), |
| 293 sizeof(kTurnSendIndicationMsgWithAbsSendTimeExtension), 3, 0)); | 297 sizeof(kTurnSendIndicationMsgWithAbsSendTimeExtension), |
| 298 3, |
| 299 0)); |
| 294 } | 300 } |
| 295 | 301 |
| 296 // Test without any packet options variables set. This method should return | 302 // Test without any packet options variables set. This method should return |
| 297 // without HMAC value in the packet. | 303 // without HMAC value in the packet. |
| 298 TEST(P2PSocketHostTest, TestApplyPacketOptionsWithDefaultValues) { | 304 TEST(P2PSocketHostTest, TestApplyPacketOptionsWithDefaultValues) { |
| 299 unsigned char fake_tag[4] = { 0xba, 0xdd, 0xba, 0xdd }; | 305 unsigned char fake_tag[4] = { 0xba, 0xdd, 0xba, 0xdd }; |
| 300 rtc::PacketOptions options; | 306 rtc::PacketOptions options; |
| 301 std::vector<char> rtp_packet; | 307 std::vector<char> rtp_packet; |
| 302 rtp_packet.resize(sizeof(kRtpMsgWithAbsSendTimeExtension) + 4); // tag length | 308 rtp_packet.resize(sizeof(kRtpMsgWithAbsSendTimeExtension) + 4); // tag length |
| 303 memcpy(&rtp_packet[0], kRtpMsgWithAbsSendTimeExtension, | 309 memcpy(&rtp_packet[0], kRtpMsgWithAbsSendTimeExtension, |
| (...skipping 30 matching lines...) Expand all Loading... |
| 334 EXPECT_NE(0, memcmp(&rtp_packet[sizeof(kRtpMsgWithAbsSendTimeExtension)], | 340 EXPECT_NE(0, memcmp(&rtp_packet[sizeof(kRtpMsgWithAbsSendTimeExtension)], |
| 335 kFakeTag, sizeof(kFakeTag))); | 341 kFakeTag, sizeof(kFakeTag))); |
| 336 | 342 |
| 337 // Verify AbsouluteSendTime extension field is not modified. | 343 // Verify AbsouluteSendTime extension field is not modified. |
| 338 EXPECT_EQ(0, memcmp(&rtp_packet[kAstIndexInRtpMsg], | 344 EXPECT_EQ(0, memcmp(&rtp_packet[kAstIndexInRtpMsg], |
| 339 kTestAstValue, sizeof(kTestAstValue))); | 345 kTestAstValue, sizeof(kTestAstValue))); |
| 340 } | 346 } |
| 341 | 347 |
| 342 // Verify finding an extension ID in a raw rtp message. | 348 // Verify finding an extension ID in a raw rtp message. |
| 343 TEST(P2PSocketHostTest, TestUpdateAbsSendTimeExtensionInRtpPacket) { | 349 TEST(P2PSocketHostTest, TestUpdateAbsSendTimeExtensionInRtpPacket) { |
| 344 EXPECT_TRUE(packet_processing_helpers::UpdateRtpAbsSendTimeExtn( | 350 EXPECT_TRUE(packet_processing_helpers::UpdateRtpAbsSendTimeExtension( |
| 345 reinterpret_cast<char*>(kRtpMsgWithAbsSendTimeExtension), | 351 reinterpret_cast<char*>(kRtpMsgWithAbsSendTimeExtension), |
| 346 sizeof(kRtpMsgWithAbsSendTimeExtension), 3, 0)); | 352 sizeof(kRtpMsgWithAbsSendTimeExtension), |
| 353 3, |
| 354 0)); |
| 347 } | 355 } |
| 348 | 356 |
| 349 // Verify we update both AbsSendTime extension header and HMAC. | 357 // Verify we update both AbsSendTime extension header and HMAC. |
| 350 TEST(P2PSocketHostTest, TestApplyPacketOptionsWithAuthParamsAndAbsSendTime) { | 358 TEST(P2PSocketHostTest, TestApplyPacketOptionsWithAuthParamsAndAbsSendTime) { |
| 351 rtc::PacketOptions options; | 359 rtc::PacketOptions options; |
| 352 options.packet_time_params.srtp_auth_key.resize(20); | 360 options.packet_time_params.srtp_auth_key.resize(20); |
| 353 options.packet_time_params.srtp_auth_key.assign( | 361 options.packet_time_params.srtp_auth_key.assign( |
| 354 kTestKey, kTestKey + sizeof(kTestKey)); | 362 kTestKey, kTestKey + sizeof(kTestKey)); |
| 355 options.packet_time_params.srtp_auth_tag_len = 4; | 363 options.packet_time_params.srtp_auth_tag_len = 4; |
| 356 options.packet_time_params.rtp_sendtime_extension_id = 3; | 364 options.packet_time_params.rtp_sendtime_extension_id = 3; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 367 EXPECT_NE(0, memcmp(&rtp_packet[sizeof(kRtpMsgWithAbsSendTimeExtension)], | 375 EXPECT_NE(0, memcmp(&rtp_packet[sizeof(kRtpMsgWithAbsSendTimeExtension)], |
| 368 kFakeTag, sizeof(kFakeTag))); | 376 kFakeTag, sizeof(kFakeTag))); |
| 369 | 377 |
| 370 // ApplyPackets should have the new timestamp passed as input. | 378 // ApplyPackets should have the new timestamp passed as input. |
| 371 unsigned char timestamp_array[3] = { 0xcc, 0xbb, 0xaa }; | 379 unsigned char timestamp_array[3] = { 0xcc, 0xbb, 0xaa }; |
| 372 EXPECT_EQ(0, memcmp(&rtp_packet[kAstIndexInRtpMsg], | 380 EXPECT_EQ(0, memcmp(&rtp_packet[kAstIndexInRtpMsg], |
| 373 timestamp_array, sizeof(timestamp_array))); | 381 timestamp_array, sizeof(timestamp_array))); |
| 374 } | 382 } |
| 375 | 383 |
| 376 } // namespace content | 384 } // namespace content |
| OLD | NEW |