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

Unified Diff: net/spdy/spdy_framer_test.cc

Issue 358483003: Remove padding from CONTINUATION frames (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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
« no previous file with comments | « net/spdy/spdy_framer.cc ('k') | no next file » | 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 6c17c6d4c79e8e2f05380cb4ecf8fc624ed2aacb..9e00bb40d0ccfb01c897d520edc7be891eb56c32 100644
--- a/net/spdy/spdy_framer_test.cc
+++ b/net/spdy/spdy_framer_test.cc
@@ -3773,7 +3773,7 @@ TEST_P(SpdyFramerTest, ReadCompressedPushPromise) {
EXPECT_TRUE(CompareHeaderBlocks(&headers, &visitor.headers_));
}
-TEST_P(SpdyFramerTest, ReadHeadersWithContinuationAndPadding) {
+TEST_P(SpdyFramerTest, ReadHeadersWithContinuation) {
if (spdy_version_ <= SPDY3) {
return;
}
@@ -3788,19 +3788,16 @@ TEST_P(SpdyFramerTest, ReadHeadersWithContinuationAndPadding) {
0x3d, 0x62, 0x61, 0x72,
0x00, 0x00, 0x00,
- 0x00, 0x1a, 0x09, 0x18, // CONTINUATION: PAD_LOW & PAD_HIGH
+ 0x00, 0x14, 0x09, 0x00, // CONTINUATION
0x00, 0x00, 0x00, 0x01, // Stream 1
- 0x00, 0x04, // Padding of 4.
0x00, 0x06, 0x63, 0x6f,
0x6f, 0x6b, 0x69, 0x65,
0x08, 0x62, 0x61, 0x7a,
0x3d, 0x62, 0x69, 0x6e,
0x67, 0x00, 0x06, 0x63,
- 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x13, 0x09, 0x0c, // CONTINUATION: PAD_LOW & END_HEADERS
+ 0x00, 0x12, 0x09, 0x04, // CONTINUATION: END_HEADERS
0x00, 0x00, 0x00, 0x01, // Stream 1
- 0x00, // Padding of 0.
0x6f, 0x6f, 0x6b, 0x69,
0x65, 0x00, 0x00, 0x04,
0x6e, 0x61, 0x6d, 0x65,
@@ -3868,7 +3865,7 @@ TEST_P(SpdyFramerTest, ReadHeadersWithContinuationAndFin) {
Pair("name", "value")));
}
-TEST_P(SpdyFramerTest, ReadPushPromiseWithContinuationAndPadding) {
+TEST_P(SpdyFramerTest, ReadPushPromiseWithContinuation) {
if (spdy_version_ <= SPDY3) {
return;
}
@@ -3884,7 +3881,7 @@ TEST_P(SpdyFramerTest, ReadPushPromiseWithContinuationAndPadding) {
0x3d, 0x62, 0x61, 0x72,
0x00, 0x00,
- 0x00, 0x14, 0x09, 0x00, // CONTINUATION:
+ 0x00, 0x14, 0x09, 0x00, // CONTINUATION
0x00, 0x00, 0x00, 0x01, // Stream 1
0x00, 0x06, 0x63, 0x6f,
0x6f, 0x6b, 0x69, 0x65,
@@ -3892,15 +3889,13 @@ TEST_P(SpdyFramerTest, ReadPushPromiseWithContinuationAndPadding) {
0x3d, 0x62, 0x69, 0x6e,
0x67, 0x00, 0x06, 0x63,
- 0x00, 0x17, 0x09, 0x0c, // CONTINUATION: PAD_LOW & END_HEADERS
+ 0x00, 0x12, 0x09, 0x04, // CONTINUATION: END_HEADERS
0x00, 0x00, 0x00, 0x01, // Stream 1
- 0x04, // Padding of 4.
0x6f, 0x6f, 0x6b, 0x69,
0x65, 0x00, 0x00, 0x04,
0x6e, 0x61, 0x6d, 0x65,
0x05, 0x76, 0x61, 0x6c,
- 0x75, 0x65, 0x00, 0x00,
- 0x00, 0x00,
+ 0x75, 0x65,
};
SpdyFramer framer(spdy_version_);
@@ -4907,14 +4902,9 @@ TEST_P(SpdyFramerTest, ContinuationFrameFlags) {
continuation.SetHeader("foo", "bar");
scoped_ptr<SpdySerializedFrame> frame(
framer.SerializeContinuation(continuation));
- // TODO(jgraettinger): Add padding to the eventual continuation
- // serialization implementation.
- int set_flags = flags & ~HEADERS_FLAG_PAD_LOW & ~HEADERS_FLAG_PAD_HIGH;
- SetFrameFlags(frame.get(), set_flags, spdy_version_);
+ SetFrameFlags(frame.get(), flags, spdy_version_);
- if (flags & ~(HEADERS_FLAG_END_HEADERS |
- HEADERS_FLAG_PAD_LOW |
- HEADERS_FLAG_PAD_HIGH)) {
+ if (flags & ~(HEADERS_FLAG_END_HEADERS)) {
EXPECT_CALL(visitor, OnError(_));
} else {
EXPECT_CALL(debug_visitor, OnReceiveCompressedFrame(42, CONTINUATION, _));
@@ -4926,9 +4916,7 @@ TEST_P(SpdyFramerTest, ContinuationFrameFlags) {
framer.ProcessInput(frame0->data(), frame0->size());
framer.ProcessInput(frame->data(), frame->size());
- if (flags & ~(HEADERS_FLAG_END_HEADERS |
- HEADERS_FLAG_PAD_LOW |
- HEADERS_FLAG_PAD_HIGH)) {
+ if (flags & ~(HEADERS_FLAG_END_HEADERS)) {
EXPECT_EQ(SpdyFramer::SPDY_ERROR, framer.state());
EXPECT_EQ(SpdyFramer::SPDY_INVALID_CONTROL_FRAME_FLAGS,
framer.error_code())
« no previous file with comments | « net/spdy/spdy_framer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698