| 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 <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "net/spdy/spdy_test_util_common.h" | 10 #include "net/spdy/spdy_test_util_common.h" |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 SpdyStreamId altsvc_stream_id_; | 172 SpdyStreamId altsvc_stream_id_; |
| 173 std::string altsvc_origin_; | 173 std::string altsvc_origin_; |
| 174 SpdyAltSvcWireFormat::AlternativeServiceVector altsvc_vector_; | 174 SpdyAltSvcWireFormat::AlternativeServiceVector altsvc_vector_; |
| 175 }; | 175 }; |
| 176 | 176 |
| 177 } // namespace | 177 } // namespace |
| 178 | 178 |
| 179 class BufferedSpdyFramerTest : public PlatformTest {}; | 179 class BufferedSpdyFramerTest : public PlatformTest {}; |
| 180 | 180 |
| 181 TEST_F(BufferedSpdyFramerTest, OnSetting) { | 181 TEST_F(BufferedSpdyFramerTest, OnSetting) { |
| 182 SpdyFramer framer; | 182 SpdyFramer framer(SpdyFramer::ENABLE_COMPRESSION); |
| 183 SpdySettingsIR settings_ir; | 183 SpdySettingsIR settings_ir; |
| 184 settings_ir.AddSetting(SETTINGS_INITIAL_WINDOW_SIZE, false, false, 2); | 184 settings_ir.AddSetting(SETTINGS_INITIAL_WINDOW_SIZE, false, false, 2); |
| 185 settings_ir.AddSetting(SETTINGS_MAX_CONCURRENT_STREAMS, false, false, 3); | 185 settings_ir.AddSetting(SETTINGS_MAX_CONCURRENT_STREAMS, false, false, 3); |
| 186 SpdySerializedFrame control_frame(framer.SerializeSettings(settings_ir)); | 186 SpdySerializedFrame control_frame(framer.SerializeSettings(settings_ir)); |
| 187 TestBufferedSpdyVisitor visitor; | 187 TestBufferedSpdyVisitor visitor; |
| 188 | 188 |
| 189 visitor.SimulateInFramer( | 189 visitor.SimulateInFramer( |
| 190 reinterpret_cast<unsigned char*>(control_frame.data()), | 190 reinterpret_cast<unsigned char*>(control_frame.data()), |
| 191 control_frame.size()); | 191 control_frame.size()); |
| 192 EXPECT_EQ(0, visitor.error_count_); | 192 EXPECT_EQ(0, visitor.error_count_); |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 altsvc_frame.size()); | 293 altsvc_frame.size()); |
| 294 EXPECT_EQ(0, visitor.error_count_); | 294 EXPECT_EQ(0, visitor.error_count_); |
| 295 EXPECT_EQ(1, visitor.altsvc_count_); | 295 EXPECT_EQ(1, visitor.altsvc_count_); |
| 296 EXPECT_EQ(altsvc_stream_id, visitor.altsvc_stream_id_); | 296 EXPECT_EQ(altsvc_stream_id, visitor.altsvc_stream_id_); |
| 297 EXPECT_EQ(altsvc_origin, visitor.altsvc_origin_); | 297 EXPECT_EQ(altsvc_origin, visitor.altsvc_origin_); |
| 298 ASSERT_EQ(1u, visitor.altsvc_vector_.size()); | 298 ASSERT_EQ(1u, visitor.altsvc_vector_.size()); |
| 299 EXPECT_EQ(alternative_service, visitor.altsvc_vector_[0]); | 299 EXPECT_EQ(alternative_service, visitor.altsvc_vector_[0]); |
| 300 } | 300 } |
| 301 | 301 |
| 302 } // namespace net | 302 } // namespace net |
| OLD | NEW |