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

Unified Diff: net/quic/test_tools/quic_test_utils.cc

Issue 47283002: Land Recent QUIC changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix compilation error Created 7 years, 2 months 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/test_tools/quic_test_utils.h ('k') | net/quic/test_tools/simple_quic_framer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « net/quic/test_tools/quic_test_utils.h ('k') | net/quic/test_tools/simple_quic_framer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698