| 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 66     // Verify that the content of the reconstructed packet is equal to the | 66     // Verify that the content of the reconstructed packet is equal to the | 
| 67     // content of |packet|, and that the same content is received |times| number | 67     // content of |packet|, and that the same content is received |times| number | 
| 68     // of times in a row. | 68     // of times in a row. | 
| 69     EXPECT_CALL(rtp_data_callback_, OnRecoveredPacket(_, packet->length)) | 69     EXPECT_CALL(rtp_data_callback_, OnRecoveredPacket(_, packet->length)) | 
| 70         .With(Args<0, 1>(ElementsAreArray(packet->data, | 70         .With(Args<0, 1>(ElementsAreArray(packet->data, | 
| 71                                           packet->length))) | 71                                           packet->length))) | 
| 72         .Times(times).WillRepeatedly(Return(true)); | 72         .Times(times).WillRepeatedly(Return(true)); | 
| 73   } | 73   } | 
| 74 | 74 | 
| 75   void BuildAndAddRedMediaPacket(test::RawRtpPacket* packet) { | 75   void BuildAndAddRedMediaPacket(test::RawRtpPacket* packet) { | 
| 76     test::RawRtpPacket* red_packet = generator_->BuildMediaRedPacket(packet); | 76     std::unique_ptr<test::RawRtpPacket> red_packet( | 
|  | 77         generator_->BuildMediaRedPacket(packet)); | 
| 77     EXPECT_EQ(0, receiver_fec_->AddReceivedRedPacket( | 78     EXPECT_EQ(0, receiver_fec_->AddReceivedRedPacket( | 
| 78                      red_packet->header.header, red_packet->data, | 79                      red_packet->header.header, red_packet->data, | 
| 79                      red_packet->length, kFecPayloadType)); | 80                      red_packet->length, kFecPayloadType)); | 
| 80     delete red_packet; |  | 
| 81   } | 81   } | 
| 82 | 82 | 
| 83   void BuildAndAddRedFecPacket(Packet* packet) { | 83   void BuildAndAddRedFecPacket(Packet* packet) { | 
| 84     test::RawRtpPacket* red_packet = generator_->BuildFecRedPacket(packet); | 84     std::unique_ptr<test::RawRtpPacket> red_packet( | 
|  | 85         generator_->BuildFecRedPacket(packet)); | 
| 85     EXPECT_EQ(0, receiver_fec_->AddReceivedRedPacket( | 86     EXPECT_EQ(0, receiver_fec_->AddReceivedRedPacket( | 
| 86                      red_packet->header.header, red_packet->data, | 87                      red_packet->header.header, red_packet->data, | 
| 87                      red_packet->length, kFecPayloadType)); | 88                      red_packet->length, kFecPayloadType)); | 
| 88     delete red_packet; |  | 
| 89   } | 89   } | 
| 90 | 90 | 
| 91   void InjectGarbagePacketLength(size_t fec_garbage_offset); | 91   void InjectGarbagePacketLength(size_t fec_garbage_offset); | 
| 92   static void SurvivesMaliciousPacket(const uint8_t* data, | 92   static void SurvivesMaliciousPacket(const uint8_t* data, | 
| 93                                       size_t length, | 93                                       size_t length, | 
| 94                                       uint8_t ulpfec_payload_type); | 94                                       uint8_t ulpfec_payload_type); | 
| 95 | 95 | 
| 96   MockRtpData rtp_data_callback_; | 96   MockRtpData rtp_data_callback_; | 
| 97   std::unique_ptr<ForwardErrorCorrection> fec_; | 97   std::unique_ptr<ForwardErrorCorrection> fec_; | 
| 98   std::unique_ptr<FecReceiver> receiver_fec_; | 98   std::unique_ptr<FecReceiver> receiver_fec_; | 
| (...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 505                              0x27, | 505                              0x27, | 
| 506                              0xc4, | 506                              0xc4, | 
| 507                              0x2a, | 507                              0x2a, | 
| 508                              0x21, | 508                              0x21, | 
| 509                              0x2a, | 509                              0x2a, | 
| 510                              0x28}; | 510                              0x28}; | 
| 511   SurvivesMaliciousPacket(kPacket, sizeof(kPacket), 100); | 511   SurvivesMaliciousPacket(kPacket, sizeof(kPacket), 100); | 
| 512 } | 512 } | 
| 513 | 513 | 
| 514 }  // namespace webrtc | 514 }  // namespace webrtc | 
| OLD | NEW | 
|---|