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 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 } | 201 } |
202 | 202 |
203 SpdyMajorVersion spdy_version() { | 203 SpdyMajorVersion spdy_version() { |
204 return NextProtoToSpdyMajorVersion(GetParam()); | 204 return NextProtoToSpdyMajorVersion(GetParam()); |
205 } | 205 } |
206 }; | 206 }; |
207 | 207 |
208 INSTANTIATE_TEST_CASE_P( | 208 INSTANTIATE_TEST_CASE_P( |
209 NextProto, | 209 NextProto, |
210 BufferedSpdyFramerTest, | 210 BufferedSpdyFramerTest, |
211 testing::Values(kProtoDeprecatedSPDY2, | 211 testing::Values(kProtoSPDY31, kProtoSPDY4_14, kProtoSPDY4_15)); |
212 kProtoSPDY3, kProtoSPDY31, kProtoSPDY4_14, kProtoSPDY4_15)); | |
213 | 212 |
214 TEST_P(BufferedSpdyFramerTest, OnSetting) { | 213 TEST_P(BufferedSpdyFramerTest, OnSetting) { |
215 SpdyFramer framer(spdy_version()); | 214 SpdyFramer framer(spdy_version()); |
216 SpdySettingsIR settings_ir; | 215 SpdySettingsIR settings_ir; |
217 settings_ir.AddSetting(SETTINGS_INITIAL_WINDOW_SIZE, false, false, 2); | 216 settings_ir.AddSetting(SETTINGS_INITIAL_WINDOW_SIZE, false, false, 2); |
218 settings_ir.AddSetting(SETTINGS_MAX_CONCURRENT_STREAMS, false, false, 3); | 217 settings_ir.AddSetting(SETTINGS_MAX_CONCURRENT_STREAMS, false, false, 3); |
219 scoped_ptr<SpdyFrame> control_frame(framer.SerializeSettings(settings_ir)); | 218 scoped_ptr<SpdyFrame> control_frame(framer.SerializeSettings(settings_ir)); |
220 TestBufferedSpdyVisitor visitor(spdy_version()); | 219 TestBufferedSpdyVisitor visitor(spdy_version()); |
221 | 220 |
222 visitor.SimulateInFramer( | 221 visitor.SimulateInFramer( |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 EXPECT_EQ(0, visitor.syn_frame_count_); | 329 EXPECT_EQ(0, visitor.syn_frame_count_); |
331 EXPECT_EQ(0, visitor.syn_reply_frame_count_); | 330 EXPECT_EQ(0, visitor.syn_reply_frame_count_); |
332 EXPECT_EQ(0, visitor.headers_frame_count_); | 331 EXPECT_EQ(0, visitor.headers_frame_count_); |
333 EXPECT_EQ(1, visitor.push_promise_frame_count_); | 332 EXPECT_EQ(1, visitor.push_promise_frame_count_); |
334 EXPECT_TRUE(CompareHeaderBlocks(&headers, &visitor.headers_)); | 333 EXPECT_TRUE(CompareHeaderBlocks(&headers, &visitor.headers_)); |
335 EXPECT_EQ(1u, visitor.header_stream_id_); | 334 EXPECT_EQ(1u, visitor.header_stream_id_); |
336 EXPECT_EQ(2u, visitor.promised_stream_id_); | 335 EXPECT_EQ(2u, visitor.promised_stream_id_); |
337 } | 336 } |
338 | 337 |
339 } // namespace net | 338 } // namespace net |
OLD | NEW |