Index: net/quic/quic_connection_test.cc |
diff --git a/net/quic/quic_connection_test.cc b/net/quic/quic_connection_test.cc |
index fe35556638dd5a50c0891ff522ecc274e79df943..15dd943af32a4fed8b3a515587788beb850b2b9f 100644 |
--- a/net/quic/quic_connection_test.cc |
+++ b/net/quic/quic_connection_test.cc |
@@ -4669,24 +4669,17 @@ TEST_P(QuicConnectionTest, ClientHandlesVersionNegotiation) { |
QuicConnectionPeer::GetFramer(&connection_)->set_version_for_tests( |
QUIC_VERSION_UNSUPPORTED); |
- QuicPacketHeader header; |
- header.public_header.connection_id = connection_id_; |
- header.public_header.version_flag = true; |
- header.packet_number = 12; |
- |
- QuicVersionVector supported_versions; |
- for (size_t i = 0; i < arraysize(kSupportedQuicVersions); ++i) { |
- supported_versions.push_back(kSupportedQuicVersions[i]); |
- } |
- |
// Send a version negotiation packet. |
scoped_ptr<QuicEncryptedPacket> encrypted( |
- framer_.BuildVersionNegotiationPacket( |
- header.public_header, supported_versions)); |
+ framer_.BuildVersionNegotiationPacket(connection_id_, |
+ QuicSupportedVersions())); |
connection_.ProcessUdpPacket(kSelfAddress, kPeerAddress, *encrypted); |
// Now force another packet. The connection should transition into |
// NEGOTIATED_VERSION state and tell the packet creator to StopSendingVersion. |
+ QuicPacketHeader header; |
+ header.public_header.connection_id = connection_id_; |
+ header.packet_number = 12; |
header.public_header.version_flag = false; |
QuicFrames frames; |
frames.push_back(QuicFrame(&frame1_)); |
@@ -4705,24 +4698,14 @@ TEST_P(QuicConnectionTest, ClientHandlesVersionNegotiation) { |
} |
TEST_P(QuicConnectionTest, BadVersionNegotiation) { |
- QuicPacketHeader header; |
- header.public_header.connection_id = connection_id_; |
- header.public_header.version_flag = true; |
- header.packet_number = 12; |
- |
- QuicVersionVector supported_versions; |
- for (size_t i = 0; i < arraysize(kSupportedQuicVersions); ++i) { |
- supported_versions.push_back(kSupportedQuicVersions[i]); |
- } |
- |
// Send a version negotiation packet with the version the client started with. |
// It should be rejected. |
EXPECT_CALL(visitor_, |
OnConnectionClosed(QUIC_INVALID_VERSION_NEGOTIATION_PACKET, |
false)); |
scoped_ptr<QuicEncryptedPacket> encrypted( |
- framer_.BuildVersionNegotiationPacket( |
- header.public_header, supported_versions)); |
+ framer_.BuildVersionNegotiationPacket(connection_id_, |
+ QuicSupportedVersions())); |
connection_.ProcessUdpPacket(kSelfAddress, kPeerAddress, *encrypted); |
} |