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

Unified Diff: net/quic/quic_framer_test.cc

Issue 125403006: Various QUIC cleanups to sync with internal code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix comments Created 6 years, 11 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/quic_framer.cc ('k') | net/quic/quic_protocol.h » ('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 1aeb0d778b1a40c2832346f1328ea4702c588e18..65b360d35cf659c9bf981d126a303250e2e416aa 100644
--- a/net/quic/quic_framer_test.cc
+++ b/net/quic/quic_framer_test.cc
@@ -42,6 +42,12 @@ const size_t kGuidOffset = kPublicFlagsSize;
// Index into the version string in the header. (if present).
const size_t kVersionOffset = kGuidOffset + PACKET_8BYTE_GUID;
+// Size in bytes of the stream frame fields for an arbitrary StreamID and
+// offset and the last frame in a packet.
+size_t GetMinStreamFrameSize(QuicVersion version) {
+ return kQuicFrameTypeSize + kQuicMaxStreamIdSize + kQuicMaxStreamOffsetSize;
+}
+
// Index into the sequence number offset in the header.
size_t GetSequenceNumberOffset(QuicGuidLength guid_length,
bool include_version) {
@@ -200,8 +206,8 @@ class TestQuicVisitor : public ::net::QuicFramerVisitorInterface {
}
virtual void OnError(QuicFramer* f) OVERRIDE {
- DLOG(INFO) << "QuicFramer Error: " << QuicUtils::ErrorToString(f->error())
- << " (" << f->error() << ")";
+ DVLOG(1) << "QuicFramer Error: " << QuicUtils::ErrorToString(f->error())
+ << " (" << f->error() << ")";
error_count_++;
}
@@ -222,17 +228,11 @@ class TestQuicVisitor : public ::net::QuicFramerVisitorInterface {
}
virtual bool OnProtocolVersionMismatch(QuicVersion version) OVERRIDE {
- DLOG(INFO) << "QuicFramer Version Mismatch, version: " << version;
+ DVLOG(1) << "QuicFramer Version Mismatch, version: " << version;
version_mismatch_++;
return true;
}
- virtual bool OnPacketHeader(const QuicPacketHeader& header) OVERRIDE {
- packet_count_++;
- header_.reset(new QuicPacketHeader(header));
- return accept_packet_;
- }
-
virtual bool OnUnauthenticatedPublicHeader(
const QuicPacketPublicHeader& header) OVERRIDE {
public_header_.reset(new QuicPacketPublicHeader(header));
@@ -244,6 +244,12 @@ class TestQuicVisitor : public ::net::QuicFramerVisitorInterface {
return true;
}
+ virtual bool OnPacketHeader(const QuicPacketHeader& header) OVERRIDE {
+ packet_count_++;
+ header_.reset(new QuicPacketHeader(header));
+ return accept_packet_;
+ }
+
virtual bool OnStreamFrame(const QuicStreamFrame& frame) OVERRIDE {
frame_count_++;
stream_frames_.push_back(new QuicStreamFrame(frame));
@@ -2302,7 +2308,7 @@ TEST_P(QuicFramerTest, PublicResetPacket) {
// Now test framing boundaries
for (size_t i = 0; i < GetPublicResetPacketSize(); ++i) {
string expected_error;
- DLOG(INFO) << "iteration: " << i;
+ DVLOG(1) << "iteration: " << i;
if (i < kGuidOffset) {
expected_error = "Unable to read public flags.";
CheckProcessingFails(packet, i, expected_error,
@@ -3281,8 +3287,7 @@ TEST_P(QuicFramerTest, EncryptPacketWithVersionFlag) {
EXPECT_TRUE(CheckEncryption(sequence_number, raw.get()));
}
-// TODO(rch) enable after landing the revised truncation CL.
-TEST_P(QuicFramerTest, DISABLED_Truncation) {
+TEST_P(QuicFramerTest, Truncation) {
QuicPacketHeader header;
header.public_header.guid = GG_UINT64_C(0xFEDCBA9876543210);
header.public_header.reset_flag = false;
« no previous file with comments | « net/quic/quic_framer.cc ('k') | net/quic/quic_protocol.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698