Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(779)

Side by Side Diff: webrtc/modules/rtp_rtcp/source/rtp_packet_unittest.cc

Issue 2801733002: Move rtp header extension length check from Packet::FindExtension to ExtensionT::Parse (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtp_packet.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2016 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 "webrtc/modules/rtp_rtcp/source/rtp_packet_received.h" 10 #include "webrtc/modules/rtp_rtcp/source/rtp_packet_received.h"
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after
351 EXPECT_TRUE(packet.Parse(kPacketWithTO, sizeof(kPacketWithTO))); 351 EXPECT_TRUE(packet.Parse(kPacketWithTO, sizeof(kPacketWithTO)));
352 352
353 EXPECT_FALSE(packet.HasRawExtension(kAudioLevelExtensionId)); 353 EXPECT_FALSE(packet.HasRawExtension(kAudioLevelExtensionId));
354 EXPECT_TRUE(packet.GetRawExtension(kAudioLevelExtensionId).empty()); 354 EXPECT_TRUE(packet.GetRawExtension(kAudioLevelExtensionId).empty());
355 355
356 EXPECT_TRUE(packet.HasRawExtension(kTransmissionOffsetExtensionId)); 356 EXPECT_TRUE(packet.HasRawExtension(kTransmissionOffsetExtensionId));
357 357
358 int32_t time_offset = 0; 358 int32_t time_offset = 0;
359 auto raw_extension = packet.GetRawExtension(kTransmissionOffsetExtensionId); 359 auto raw_extension = packet.GetRawExtension(kTransmissionOffsetExtensionId);
360 EXPECT_EQ(raw_extension.size(), TransmissionOffset::kValueSizeBytes); 360 EXPECT_EQ(raw_extension.size(), TransmissionOffset::kValueSizeBytes);
361 EXPECT_TRUE(TransmissionOffset::Parse(raw_extension.data(), &time_offset)); 361 EXPECT_TRUE(TransmissionOffset::Parse(raw_extension, &time_offset));
362 362
363 EXPECT_EQ(time_offset, kTimeOffset); 363 EXPECT_EQ(time_offset, kTimeOffset);
364 } 364 }
365 365
366 } // namespace webrtc 366 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtp_packet.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698