OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/spdy_deframer_visitor.h" | 5 #include "net/spdy/spdy_deframer_visitor.h" |
6 | 6 |
7 #include <stdlib.h> | 7 #include <stdlib.h> |
8 #include <string.h> | 8 #include <string.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 15 matching lines...) Expand all Loading... |
26 using ::std::string; | 26 using ::std::string; |
27 | 27 |
28 namespace net { | 28 namespace net { |
29 namespace test { | 29 namespace test { |
30 namespace { | 30 namespace { |
31 | 31 |
32 class SpdyDeframerVisitorTest : public ::testing::Test { | 32 class SpdyDeframerVisitorTest : public ::testing::Test { |
33 protected: | 33 protected: |
34 SpdyDeframerVisitorTest() : encoder_(HTTP2), decoder_(HTTP2) { | 34 SpdyDeframerVisitorTest() : encoder_(HTTP2), decoder_(HTTP2) { |
35 decoder_.set_process_single_input_frame(true); | 35 decoder_.set_process_single_input_frame(true); |
36 decoder_.set_use_new_methods_for_test(true); | |
37 auto collector = MakeUnique<DeframerCallbackCollector>(&collected_frames_); | 36 auto collector = MakeUnique<DeframerCallbackCollector>(&collected_frames_); |
38 auto log_and_collect = | 37 auto log_and_collect = |
39 SpdyDeframerVisitorInterface::LogBeforeVisiting(std::move(collector)); | 38 SpdyDeframerVisitorInterface::LogBeforeVisiting(std::move(collector)); |
40 deframer_ = SpdyTestDeframer::CreateConverter(std::move(log_and_collect)); | 39 deframer_ = SpdyTestDeframer::CreateConverter(std::move(log_and_collect)); |
41 decoder_.set_visitor(deframer_.get()); | 40 decoder_.set_visitor(deframer_.get()); |
42 } | 41 } |
43 | 42 |
44 bool DeframeInput(const char* input, size_t size) { | 43 bool DeframeInput(const char* input, size_t size) { |
45 size_t input_remaining = size; | 44 size_t input_remaining = size; |
46 while (input_remaining > 0 && | 45 while (input_remaining > 0 && |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 // TODO(jamessynge): Please implement. | 263 // TODO(jamessynge): Please implement. |
265 } | 264 } |
266 | 265 |
267 TEST_F(SpdyDeframerVisitorTest, DISABLED_AltSvcFrame) { | 266 TEST_F(SpdyDeframerVisitorTest, DISABLED_AltSvcFrame) { |
268 // TODO(jamessynge): Please implement. | 267 // TODO(jamessynge): Please implement. |
269 } | 268 } |
270 | 269 |
271 } // namespace | 270 } // namespace |
272 } // namespace test | 271 } // namespace test |
273 } // namespace net | 272 } // namespace net |
OLD | NEW |