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

Unified Diff: net/spdy/spdy_framer_test.cc

Issue 354483005: SPDY cleanup: use ParseFrameType and SerializeFrameType (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Compile fix. Created 6 years, 6 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
Index: net/spdy/spdy_framer_test.cc
diff --git a/net/spdy/spdy_framer_test.cc b/net/spdy/spdy_framer_test.cc
index 980a74157f5296e61b235b24b434731703742322..390bc6e1379d03d2774670d9b89aa01508e95dad 100644
--- a/net/spdy/spdy_framer_test.cc
+++ b/net/spdy/spdy_framer_test.cc
@@ -327,7 +327,11 @@ class TestSpdyVisitor : public SpdyFramerVisitorInterface,
bool fin,
bool unidirectional) OVERRIDE {
++syn_frame_count_;
- InitHeaderStreaming(SYN_STREAM, stream_id);
+ if (framer_.protocol_version() > SPDY3) {
+ InitHeaderStreaming(HEADERS, stream_id);
+ } else {
+ InitHeaderStreaming(SYN_STREAM, stream_id);
+ }
if (fin) {
++fin_flag_count_;
}
@@ -335,7 +339,11 @@ class TestSpdyVisitor : public SpdyFramerVisitorInterface,
virtual void OnSynReply(SpdyStreamId stream_id, bool fin) OVERRIDE {
++syn_reply_frame_count_;
- InitHeaderStreaming(SYN_REPLY, stream_id);
+ if (framer_.protocol_version() > SPDY3) {
+ InitHeaderStreaming(HEADERS, stream_id);
+ } else {
+ InitHeaderStreaming(SYN_REPLY, stream_id);
+ }
if (fin) {
++fin_flag_count_;
}
@@ -459,8 +467,13 @@ class TestSpdyVisitor : public SpdyFramerVisitorInterface,
void InitHeaderStreaming(SpdyFrameType header_control_type,
SpdyStreamId stream_id) {
- DCHECK_GE(header_control_type, FIRST_CONTROL_TYPE);
- DCHECK_LE(header_control_type, LAST_CONTROL_TYPE);
+ if (!SpdyConstants::IsValidFrameType(framer_.protocol_version(),
+ SpdyConstants::SerializeFrameType(framer_.protocol_version(),
+ header_control_type))) {
+ DLOG(FATAL) << "Attempted to init header streaming with "
+ << "invalid control frame type: "
+ << header_control_type;
+ }
memset(header_buffer_.get(), 0, header_buffer_size_);
header_buffer_length_ = 0;
header_stream_id_ = stream_id;
@@ -4317,8 +4330,6 @@ TEST_P(SpdyFramerTest, FrameTypeToStringTest) {
SpdyFramer::FrameTypeToString(RST_STREAM));
EXPECT_STREQ("SETTINGS",
SpdyFramer::FrameTypeToString(SETTINGS));
- EXPECT_STREQ("NOOP",
- SpdyFramer::FrameTypeToString(NOOP));
EXPECT_STREQ("PING",
SpdyFramer::FrameTypeToString(PING));
EXPECT_STREQ("GOAWAY",
« net/spdy/spdy_framer.cc ('K') | « net/spdy/spdy_framer.cc ('k') | net/spdy/spdy_protocol.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698