OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "net/spdy/buffered_spdy_framer.h" | 5 #include "net/spdy/buffered_spdy_framer.h" |
6 | 6 |
7 #include "net/spdy/spdy_test_util_common.h" | 7 #include "net/spdy/spdy_test_util_common.h" |
8 #include "testing/platform_test.h" | 8 #include "testing/platform_test.h" |
9 | 9 |
10 namespace net { | 10 namespace net { |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 control_frame.get()->size()); | 244 control_frame.get()->size()); |
245 EXPECT_EQ(0, visitor.error_count_); | 245 EXPECT_EQ(0, visitor.error_count_); |
246 EXPECT_EQ(1, visitor.syn_frame_count_); | 246 EXPECT_EQ(1, visitor.syn_frame_count_); |
247 EXPECT_EQ(0, visitor.syn_reply_frame_count_); | 247 EXPECT_EQ(0, visitor.syn_reply_frame_count_); |
248 EXPECT_EQ(0, visitor.headers_frame_count_); | 248 EXPECT_EQ(0, visitor.headers_frame_count_); |
249 EXPECT_EQ(0, visitor.push_promise_frame_count_); | 249 EXPECT_EQ(0, visitor.push_promise_frame_count_); |
250 EXPECT_TRUE(CompareHeaderBlocks(&headers, &visitor.headers_)); | 250 EXPECT_TRUE(CompareHeaderBlocks(&headers, &visitor.headers_)); |
251 } | 251 } |
252 | 252 |
253 TEST_P(BufferedSpdyFramerTest, ReadSynReplyHeaderBlock) { | 253 TEST_P(BufferedSpdyFramerTest, ReadSynReplyHeaderBlock) { |
| 254 if (spdy_version() > SPDY3) { |
| 255 return; |
| 256 } |
254 SpdyHeaderBlock headers; | 257 SpdyHeaderBlock headers; |
255 headers["alpha"] = "beta"; | 258 headers["alpha"] = "beta"; |
256 headers["gamma"] = "delta"; | 259 headers["gamma"] = "delta"; |
257 BufferedSpdyFramer framer(spdy_version(), true); | 260 BufferedSpdyFramer framer(spdy_version(), true); |
258 scoped_ptr<SpdyFrame> control_frame( | 261 scoped_ptr<SpdyFrame> control_frame( |
259 framer.CreateSynReply(1, // stream_id | 262 framer.CreateSynReply(1, // stream_id |
260 CONTROL_FLAG_NONE, | 263 CONTROL_FLAG_NONE, |
261 &headers)); | 264 &headers)); |
262 EXPECT_TRUE(control_frame.get() != NULL); | 265 EXPECT_TRUE(control_frame.get() != NULL); |
263 | 266 |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
320 EXPECT_EQ(0, visitor.syn_frame_count_); | 323 EXPECT_EQ(0, visitor.syn_frame_count_); |
321 EXPECT_EQ(0, visitor.syn_reply_frame_count_); | 324 EXPECT_EQ(0, visitor.syn_reply_frame_count_); |
322 EXPECT_EQ(0, visitor.headers_frame_count_); | 325 EXPECT_EQ(0, visitor.headers_frame_count_); |
323 EXPECT_EQ(1, visitor.push_promise_frame_count_); | 326 EXPECT_EQ(1, visitor.push_promise_frame_count_); |
324 EXPECT_TRUE(CompareHeaderBlocks(&headers, &visitor.headers_)); | 327 EXPECT_TRUE(CompareHeaderBlocks(&headers, &visitor.headers_)); |
325 EXPECT_EQ(1u, visitor.header_stream_id_); | 328 EXPECT_EQ(1u, visitor.header_stream_id_); |
326 EXPECT_EQ(2u, visitor.promised_stream_id_); | 329 EXPECT_EQ(2u, visitor.promised_stream_id_); |
327 } | 330 } |
328 | 331 |
329 } // namespace net | 332 } // namespace net |
OLD | NEW |