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 "base/logging.h" | 7 #include "base/logging.h" |
8 #include "net/spdy/spdy_test_util_common.h" | 8 #include "net/spdy/spdy_test_util_common.h" |
9 #include "testing/platform_test.h" | 9 #include "testing/platform_test.h" |
10 | 10 |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
125 SpdyStreamId promised_stream_id, | 125 SpdyStreamId promised_stream_id, |
126 const SpdyHeaderBlock& headers) override { | 126 const SpdyHeaderBlock& headers) override { |
127 header_stream_id_ = stream_id; | 127 header_stream_id_ = stream_id; |
128 EXPECT_NE(header_stream_id_, SpdyFramer::kInvalidStream); | 128 EXPECT_NE(header_stream_id_, SpdyFramer::kInvalidStream); |
129 push_promise_frame_count_++; | 129 push_promise_frame_count_++; |
130 promised_stream_id_ = promised_stream_id; | 130 promised_stream_id_ = promised_stream_id; |
131 EXPECT_NE(promised_stream_id_, SpdyFramer::kInvalidStream); | 131 EXPECT_NE(promised_stream_id_, SpdyFramer::kInvalidStream); |
132 headers_ = headers; | 132 headers_ = headers; |
133 } | 133 } |
134 | 134 |
135 void OnAltSvc(SpdyStreamId stream_id, | |
136 base::StringPiece origin, | |
137 const SpdyAltSvcWireFormat::AlternativeServiceVector& | |
138 altsvc_vector) override {} | |
Ryan Hamilton
2016/06/03 19:05:18
perhaps we could save the alt svc vector and write
Bence
2016/06/03 20:57:52
Done.
| |
139 | |
135 bool OnUnknownFrame(SpdyStreamId stream_id, int frame_type) override { | 140 bool OnUnknownFrame(SpdyStreamId stream_id, int frame_type) override { |
136 return true; | 141 return true; |
137 } | 142 } |
138 | 143 |
139 // Convenience function which runs a framer simulation with particular input. | 144 // Convenience function which runs a framer simulation with particular input. |
140 void SimulateInFramer(const unsigned char* input, size_t size) { | 145 void SimulateInFramer(const unsigned char* input, size_t size) { |
141 buffered_spdy_framer_.set_visitor(this); | 146 buffered_spdy_framer_.set_visitor(this); |
142 size_t input_remaining = size; | 147 size_t input_remaining = size; |
143 const char* input_ptr = reinterpret_cast<const char*>(input); | 148 const char* input_ptr = reinterpret_cast<const char*>(input); |
144 while (input_remaining > 0 && | 149 while (input_remaining > 0 && |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
332 reinterpret_cast<unsigned char*>(goaway_frame.get()->data()), | 337 reinterpret_cast<unsigned char*>(goaway_frame.get()->data()), |
333 goaway_frame.get()->size()); | 338 goaway_frame.get()->size()); |
334 EXPECT_EQ(0, visitor.error_count_); | 339 EXPECT_EQ(0, visitor.error_count_); |
335 EXPECT_EQ(1, visitor.goaway_count_); | 340 EXPECT_EQ(1, visitor.goaway_count_); |
336 EXPECT_EQ(2u, visitor.goaway_last_accepted_stream_id_); | 341 EXPECT_EQ(2u, visitor.goaway_last_accepted_stream_id_); |
337 EXPECT_EQ(GOAWAY_FRAME_SIZE_ERROR, visitor.goaway_status_); | 342 EXPECT_EQ(GOAWAY_FRAME_SIZE_ERROR, visitor.goaway_status_); |
338 EXPECT_EQ("foo", visitor.goaway_debug_data_); | 343 EXPECT_EQ("foo", visitor.goaway_debug_data_); |
339 } | 344 } |
340 | 345 |
341 } // namespace net | 346 } // namespace net |
OLD | NEW |