summaryrefslogtreecommitdiffstats
path: root/net/quic/test_tools/quic_test_utils.cc
diff options
context:
space:
mode:
Diffstat (limited to 'net/quic/test_tools/quic_test_utils.cc')
-rw-r--r--net/quic/test_tools/quic_test_utils.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/net/quic/test_tools/quic_test_utils.cc b/net/quic/test_tools/quic_test_utils.cc
index bc9fbc4..3d9267a 100644
--- a/net/quic/test_tools/quic_test_utils.cc
+++ b/net/quic/test_tools/quic_test_utils.cc
@@ -545,6 +545,15 @@ QuicEncryptedPacket* ConstructEncryptedPacket(
return new QuicEncryptedPacket(buffer, encrypted_length, true);
}
+QuicReceivedPacket* ConstructReceivedPacket(
+ const QuicEncryptedPacket& encrypted_packet,
+ QuicTime receipt_time) {
+ char* buffer = new char[encrypted_packet.length()];
+ memcpy(buffer, encrypted_packet.data(), encrypted_packet.length());
+ return new QuicReceivedPacket(buffer, encrypted_packet.length(), receipt_time,
+ true);
+}
+
QuicEncryptedPacket* ConstructMisFramedEncryptedPacket(
QuicConnectionId connection_id,
bool version_flag,