| 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 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 INSTANTIATE_TEST_CASE_P( | 192 INSTANTIATE_TEST_CASE_P( |
| 193 NextProto, | 193 NextProto, |
| 194 BufferedSpdyFramerTest, | 194 BufferedSpdyFramerTest, |
| 195 testing::Values(kProtoDeprecatedSPDY2, | 195 testing::Values(kProtoDeprecatedSPDY2, |
| 196 kProtoSPDY3, kProtoSPDY31, kProtoSPDY4a2, | 196 kProtoSPDY3, kProtoSPDY31, kProtoSPDY4a2, |
| 197 kProtoHTTP2Draft04)); | 197 kProtoHTTP2Draft04)); |
| 198 | 198 |
| 199 TEST_P(BufferedSpdyFramerTest, OnSetting) { | 199 TEST_P(BufferedSpdyFramerTest, OnSetting) { |
| 200 SpdyFramer framer(spdy_version()); | 200 SpdyFramer framer(spdy_version()); |
| 201 SpdySettingsIR settings_ir; | 201 SpdySettingsIR settings_ir; |
| 202 settings_ir.AddSetting(SETTINGS_UPLOAD_BANDWIDTH, false, false, 0x00000002); | 202 settings_ir.AddSetting(SETTINGS_INITIAL_WINDOW_SIZE, false, false, 2); |
| 203 settings_ir.AddSetting(SETTINGS_DOWNLOAD_BANDWIDTH, false, false, 0x00000003); | 203 settings_ir.AddSetting(SETTINGS_MAX_CONCURRENT_STREAMS, false, false, 3); |
| 204 scoped_ptr<SpdyFrame> control_frame(framer.SerializeSettings(settings_ir)); | 204 scoped_ptr<SpdyFrame> control_frame(framer.SerializeSettings(settings_ir)); |
| 205 TestBufferedSpdyVisitor visitor(spdy_version()); | 205 TestBufferedSpdyVisitor visitor(spdy_version()); |
| 206 | 206 |
| 207 visitor.SimulateInFramer( | 207 visitor.SimulateInFramer( |
| 208 reinterpret_cast<unsigned char*>(control_frame->data()), | 208 reinterpret_cast<unsigned char*>(control_frame->data()), |
| 209 control_frame->size()); | 209 control_frame->size()); |
| 210 EXPECT_EQ(0, visitor.error_count_); | 210 EXPECT_EQ(0, visitor.error_count_); |
| 211 EXPECT_EQ(2, visitor.setting_count_); | 211 EXPECT_EQ(2, visitor.setting_count_); |
| 212 } | 212 } |
| 213 | 213 |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 reinterpret_cast<unsigned char*>(control_frame.get()->data()), | 278 reinterpret_cast<unsigned char*>(control_frame.get()->data()), |
| 279 control_frame.get()->size()); | 279 control_frame.get()->size()); |
| 280 EXPECT_EQ(0, visitor.error_count_); | 280 EXPECT_EQ(0, visitor.error_count_); |
| 281 EXPECT_EQ(0, visitor.syn_frame_count_); | 281 EXPECT_EQ(0, visitor.syn_frame_count_); |
| 282 EXPECT_EQ(0, visitor.syn_reply_frame_count_); | 282 EXPECT_EQ(0, visitor.syn_reply_frame_count_); |
| 283 EXPECT_EQ(1, visitor.headers_frame_count_); | 283 EXPECT_EQ(1, visitor.headers_frame_count_); |
| 284 EXPECT_TRUE(CompareHeaderBlocks(&headers, &visitor.headers_)); | 284 EXPECT_TRUE(CompareHeaderBlocks(&headers, &visitor.headers_)); |
| 285 } | 285 } |
| 286 | 286 |
| 287 } // namespace net | 287 } // namespace net |
| OLD | NEW |