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

Unified Diff: net/quic/quic_framer_test.cc

Issue 1421853006: Landing Recent QUIC changes until: Fri Oct 30 22:23:58 2015 +0000 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix comments Created 5 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/quic/quic_framer.cc ('k') | net/quic/quic_headers_stream.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_framer_test.cc
diff --git a/net/quic/quic_framer_test.cc b/net/quic/quic_framer_test.cc
index 51430b3d07799eb6a16455b46a5f34b691122331..4a3d3be7d81f4d72817923c49e21a104cad51541 100644
--- a/net/quic/quic_framer_test.cc
+++ b/net/quic/quic_framer_test.cc
@@ -2186,7 +2186,7 @@ TEST_P(QuicFramerTest, AckFrame500Nacks) {
QuicAckFrame* frame = visitor_.ack_frames_[0];
EXPECT_EQ(0xBA, frame->entropy_hash);
EXPECT_EQ(UINT64_C(0x0123456789ABF), frame->largest_observed);
- EXPECT_EQ(0u, frame->revived_packets.size());
+ EXPECT_EQ(0u, frame->latest_revived_packet);
ASSERT_EQ(500u, frame->missing_packets.NumPacketsSlow());
EXPECT_EQ(UINT64_C(0x0123456789ABE) - 499, frame->missing_packets.Min());
EXPECT_EQ(UINT64_C(0x0123456789ABE), frame->missing_packets.Max());
@@ -4023,10 +4023,10 @@ TEST_P(QuicFramerTest, EncryptPacket) {
AsChars(packet), arraysize(packet), false, PACKET_8BYTE_CONNECTION_ID,
!kIncludeVersion, PACKET_6BYTE_PACKET_NUMBER));
char buffer[kMaxPacketSize];
- scoped_ptr<QuicEncryptedPacket> encrypted(framer_.EncryptPayload(
- ENCRYPTION_NONE, packet_number, *raw, buffer, kMaxPacketSize));
+ size_t encrypted_length = framer_.EncryptPayload(
+ ENCRYPTION_NONE, packet_number, *raw, buffer, kMaxPacketSize);
- ASSERT_TRUE(encrypted.get() != nullptr);
+ ASSERT_NE(0u, encrypted_length);
EXPECT_TRUE(CheckEncryption(packet_number, raw.get()));
}
@@ -4061,10 +4061,10 @@ TEST_P(QuicFramerTest, EncryptPacketWithVersionFlag) {
AsChars(packet), arraysize(packet), false, PACKET_8BYTE_CONNECTION_ID,
kIncludeVersion, PACKET_6BYTE_PACKET_NUMBER));
char buffer[kMaxPacketSize];
- scoped_ptr<QuicEncryptedPacket> encrypted(framer_.EncryptPayload(
- ENCRYPTION_NONE, packet_number, *raw, buffer, kMaxPacketSize));
+ size_t encrypted_length = framer_.EncryptPayload(
+ ENCRYPTION_NONE, packet_number, *raw, buffer, kMaxPacketSize);
- ASSERT_TRUE(encrypted.get() != nullptr);
+ ASSERT_NE(0u, encrypted_length);
EXPECT_TRUE(CheckEncryption(packet_number, raw.get()));
}
@@ -4090,11 +4090,13 @@ TEST_P(QuicFramerTest, AckTruncationLargePacket) {
scoped_ptr<QuicPacket> raw_ack_packet(BuildDataPacket(header, frames));
ASSERT_TRUE(raw_ack_packet != nullptr);
char buffer[kMaxPacketSize];
- scoped_ptr<QuicEncryptedPacket> ack_packet(
+ size_t encrypted_length =
framer_.EncryptPayload(ENCRYPTION_NONE, header.packet_number,
- *raw_ack_packet, buffer, kMaxPacketSize));
+ *raw_ack_packet, buffer, kMaxPacketSize);
+ ASSERT_NE(0u, encrypted_length);
// Now make sure we can turn our ack packet back into an ack frame.
- ASSERT_TRUE(framer_.ProcessPacket(*ack_packet));
+ ASSERT_TRUE(framer_.ProcessPacket(
+ QuicEncryptedPacket(buffer, encrypted_length, false)));
ASSERT_EQ(1u, visitor_.ack_frames_.size());
QuicAckFrame& processed_ack_frame = *visitor_.ack_frames_[0];
EXPECT_TRUE(processed_ack_frame.is_truncated);
@@ -4126,11 +4128,13 @@ TEST_P(QuicFramerTest, AckTruncationSmallPacket) {
scoped_ptr<QuicPacket> raw_ack_packet(BuildDataPacket(header, frames, 500));
ASSERT_TRUE(raw_ack_packet != nullptr);
char buffer[kMaxPacketSize];
- scoped_ptr<QuicEncryptedPacket> ack_packet(
+ size_t encrypted_length =
framer_.EncryptPayload(ENCRYPTION_NONE, header.packet_number,
- *raw_ack_packet, buffer, kMaxPacketSize));
+ *raw_ack_packet, buffer, kMaxPacketSize);
+ ASSERT_NE(0u, encrypted_length);
// Now make sure we can turn our ack packet back into an ack frame.
- ASSERT_TRUE(framer_.ProcessPacket(*ack_packet));
+ ASSERT_TRUE(framer_.ProcessPacket(
+ QuicEncryptedPacket(buffer, encrypted_length, false)));
ASSERT_EQ(1u, visitor_.ack_frames_.size());
QuicAckFrame& processed_ack_frame = *visitor_.ack_frames_[0];
EXPECT_TRUE(processed_ack_frame.is_truncated);
@@ -4165,12 +4169,14 @@ TEST_P(QuicFramerTest, CleanTruncation) {
ASSERT_TRUE(raw_ack_packet != nullptr);
char buffer[kMaxPacketSize];
- scoped_ptr<QuicEncryptedPacket> ack_packet(
+ size_t encrypted_length =
framer_.EncryptPayload(ENCRYPTION_NONE, header.packet_number,
- *raw_ack_packet, buffer, kMaxPacketSize));
+ *raw_ack_packet, buffer, kMaxPacketSize);
+ ASSERT_NE(0u, encrypted_length);
// Now make sure we can turn our ack packet back into an ack frame.
- ASSERT_TRUE(framer_.ProcessPacket(*ack_packet));
+ ASSERT_TRUE(framer_.ProcessPacket(
+ QuicEncryptedPacket(buffer, encrypted_length, false)));
// Test for clean truncation of the ack by comparing the length of the
// original packets to the re-serialized packets.
« no previous file with comments | « net/quic/quic_framer.cc ('k') | net/quic/quic_headers_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698