| 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 13 matching lines...) Expand all Loading... |
| 24 | 24 |
| 25 using ::base::MakeUnique; | 25 using ::base::MakeUnique; |
| 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() { | 34 SpdyDeframerVisitorTest() |
| 35 : encoder_(SpdyFramer::ENABLE_COMPRESSION), |
| 36 decoder_(SpdyFramer::ENABLE_COMPRESSION) { |
| 35 decoder_.set_process_single_input_frame(true); | 37 decoder_.set_process_single_input_frame(true); |
| 36 auto collector = MakeUnique<DeframerCallbackCollector>(&collected_frames_); | 38 auto collector = MakeUnique<DeframerCallbackCollector>(&collected_frames_); |
| 37 auto log_and_collect = | 39 auto log_and_collect = |
| 38 SpdyDeframerVisitorInterface::LogBeforeVisiting(std::move(collector)); | 40 SpdyDeframerVisitorInterface::LogBeforeVisiting(std::move(collector)); |
| 39 deframer_ = SpdyTestDeframer::CreateConverter(std::move(log_and_collect)); | 41 deframer_ = SpdyTestDeframer::CreateConverter(std::move(log_and_collect)); |
| 40 decoder_.set_visitor(deframer_.get()); | 42 decoder_.set_visitor(deframer_.get()); |
| 41 } | 43 } |
| 42 | 44 |
| 43 bool DeframeInput(const char* input, size_t size) { | 45 bool DeframeInput(const char* input, size_t size) { |
| 44 size_t input_remaining = size; | 46 size_t input_remaining = size; |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 // TODO(jamessynge): Please implement. | 265 // TODO(jamessynge): Please implement. |
| 264 } | 266 } |
| 265 | 267 |
| 266 TEST_F(SpdyDeframerVisitorTest, DISABLED_AltSvcFrame) { | 268 TEST_F(SpdyDeframerVisitorTest, DISABLED_AltSvcFrame) { |
| 267 // TODO(jamessynge): Please implement. | 269 // TODO(jamessynge): Please implement. |
| 268 } | 270 } |
| 269 | 271 |
| 270 } // namespace | 272 } // namespace |
| 271 } // namespace test | 273 } // namespace test |
| 272 } // namespace net | 274 } // namespace net |
| OLD | NEW |