| Index: net/quic/test_tools/quic_test_utils.cc
|
| diff --git a/net/quic/test_tools/quic_test_utils.cc b/net/quic/test_tools/quic_test_utils.cc
|
| index d2bc7e9bfb5a429800d79e0156a3e37640b9df37..e1d148fe7bc1d5a19ceadf030dfd7c486e798966 100644
|
| --- a/net/quic/test_tools/quic_test_utils.cc
|
| +++ b/net/quic/test_tools/quic_test_utils.cc
|
| @@ -213,7 +213,7 @@ MockConnection::MockConnection(QuicGuid guid,
|
| bool is_server)
|
| : QuicConnection(guid, address, new testing::NiceMock<MockHelper>(),
|
| new testing::NiceMock<MockPacketWriter>(),
|
| - is_server, QuicVersionMax()),
|
| + is_server, QuicSupportedVersions()),
|
| has_mock_helper_(true),
|
| writer_(QuicConnectionPeer::GetWriter(this)),
|
| helper_(helper()) {
|
| @@ -225,7 +225,7 @@ MockConnection::MockConnection(QuicGuid guid,
|
| QuicPacketWriter* writer,
|
| bool is_server)
|
| : QuicConnection(guid, address, helper, writer, is_server,
|
| - QuicVersionMax()),
|
| + QuicSupportedVersions()),
|
| has_mock_helper_(false) {
|
| }
|
|
|
| @@ -350,12 +350,17 @@ string HexDumpWithMarks(const char* data, int length,
|
|
|
| } // namespace
|
|
|
| +QuicVersion QuicVersionMax() { return QuicSupportedVersions().front(); }
|
| +
|
| +QuicVersion QuicVersionMin() { return QuicSupportedVersions().back(); }
|
| +
|
| void CompareCharArraysWithHexError(
|
| const string& description,
|
| const char* actual,
|
| const int actual_len,
|
| const char* expected,
|
| const int expected_len) {
|
| + EXPECT_EQ(actual_len, expected_len);
|
| const int min_len = min(actual_len, expected_len);
|
| const int max_len = max(actual_len, expected_len);
|
| scoped_ptr<bool[]> marks(new bool[max_len]);
|
| @@ -387,7 +392,7 @@ static QuicPacket* ConstructPacketFromHandshakeMessage(
|
| bool should_include_version) {
|
| CryptoFramer crypto_framer;
|
| scoped_ptr<QuicData> data(crypto_framer.ConstructHandshakeMessage(message));
|
| - QuicFramer quic_framer(QuicVersionMax(), QuicTime::Zero(), false);
|
| + QuicFramer quic_framer(QuicSupportedVersions(), QuicTime::Zero(), false);
|
|
|
| QuicPacketHeader header;
|
| header.public_header.guid = guid;
|
| @@ -421,13 +426,12 @@ size_t GetPacketLengthForOneStream(
|
| InFecGroup is_in_fec_group,
|
| size_t* payload_length) {
|
| *payload_length = 1;
|
| - bool use_short_hash = version >= QUIC_VERSION_11;
|
| const size_t stream_length =
|
| - NullEncrypter(use_short_hash).GetCiphertextSize(*payload_length) +
|
| + NullEncrypter(false).GetCiphertextSize(*payload_length) +
|
| QuicPacketCreator::StreamFramePacketOverhead(
|
| version, PACKET_8BYTE_GUID, include_version,
|
| sequence_number_length, is_in_fec_group);
|
| - const size_t ack_length = NullEncrypter(use_short_hash).GetCiphertextSize(
|
| + const size_t ack_length = NullEncrypter(false).GetCiphertextSize(
|
| QuicFramer::GetMinAckFrameSize()) +
|
| GetPacketHeaderSize(PACKET_8BYTE_GUID, include_version,
|
| sequence_number_length, is_in_fec_group);
|
| @@ -435,7 +439,7 @@ size_t GetPacketLengthForOneStream(
|
| *payload_length = 1 + ack_length - stream_length;
|
| }
|
|
|
| - return NullEncrypter(use_short_hash).GetCiphertextSize(*payload_length) +
|
| + return NullEncrypter(false).GetCiphertextSize(*payload_length) +
|
| QuicPacketCreator::StreamFramePacketOverhead(
|
| version, PACKET_8BYTE_GUID, include_version,
|
| sequence_number_length, is_in_fec_group);
|
|
|