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

Unified Diff: net/spdy/spdy_framer_test.cc

Issue 243643002: Refactor RST_STREAM status code handling. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Expanded FRAME_TOO_LARGE/FRAME_SIZE_ERROR comment. Created 6 years, 8 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/spdy/spdy_framer.cc ('k') | net/spdy/spdy_protocol.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/spdy_framer_test.cc
diff --git a/net/spdy/spdy_framer_test.cc b/net/spdy/spdy_framer_test.cc
index 039f4de87093b7ed6bfd315f5d838cb68b326be1..d6f1a7eabd8f321c2d79cd59cd6669a546091aa0 100644
--- a/net/spdy/spdy_framer_test.cc
+++ b/net/spdy/spdy_framer_test.cc
@@ -3933,7 +3933,7 @@ TEST_P(SpdyFramerTest, StatusCodeToStringTest) {
EXPECT_STREQ("FLOW_CONTROL_ERROR",
SpdyFramer::StatusCodeToString(RST_STREAM_FLOW_CONTROL_ERROR));
EXPECT_STREQ("UNKNOWN_STATUS",
- SpdyFramer::StatusCodeToString(RST_STREAM_NUM_STATUS_CODES));
+ SpdyFramer::StatusCodeToString(-1));
}
TEST_P(SpdyFramerTest, FrameTypeToStringTest) {
@@ -4623,30 +4623,30 @@ TEST_P(SpdyFramerTest, SettingsFlagsAndId) {
// Test handling of a RST_STREAM with out-of-bounds status codes.
TEST_P(SpdyFramerTest, RstStreamStatusBounds) {
- DCHECK_GE(0xff, RST_STREAM_NUM_STATUS_CODES);
-
+ const unsigned char kRstStreamStatusTooLow = 0x00;
+ const unsigned char kRstStreamStatusTooHigh = 0xff;
const unsigned char kV3RstStreamInvalid[] = {
0x80, spdy_version_ch_, 0x00, 0x03,
0x00, 0x00, 0x00, 0x08,
0x00, 0x00, 0x00, 0x01,
- 0x00, 0x00, 0x00, RST_STREAM_INVALID
+ 0x00, 0x00, 0x00, kRstStreamStatusTooLow
};
const unsigned char kV4RstStreamInvalid[] = {
0x00, 0x04, 0x03, 0x00,
0x00, 0x00, 0x00, 0x01,
- 0x00, 0x00, 0x00, RST_STREAM_INVALID
+ 0x00, 0x00, 0x00, kRstStreamStatusTooLow
};
const unsigned char kV3RstStreamNumStatusCodes[] = {
0x80, spdy_version_ch_, 0x00, 0x03,
0x00, 0x00, 0x00, 0x08,
0x00, 0x00, 0x00, 0x01,
- 0x00, 0x00, 0x00, RST_STREAM_NUM_STATUS_CODES
+ 0x00, 0x00, 0x00, kRstStreamStatusTooHigh
};
const unsigned char kV4RstStreamNumStatusCodes[] = {
0x00, 0x04, 0x03, 0x00,
0x00, 0x00, 0x00, 0x01,
- 0x00, 0x00, 0x00, RST_STREAM_NUM_STATUS_CODES
+ 0x00, 0x00, 0x00, kRstStreamStatusTooHigh
};
testing::StrictMock<test::MockSpdyFramerVisitor> visitor;
« no previous file with comments | « 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