Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(54)

Side by Side Diff: net/spdy/core/spdy_deframer_visitor_test.cc

Issue 2840563003: Implement SpdyMakeUnique and SpdyWrapUnique. (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/spdy/core/spdy_deframer_visitor.cc ('k') | net/spdy/core/spdy_frame_builder.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/core/spdy_deframer_visitor.h" 5 #include "net/spdy/core/spdy_deframer_visitor.h"
6 6
7 #include <stdlib.h> 7 #include <stdlib.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <limits> 10 #include <limits>
11 11
12 #include "base/logging.h" 12 #include "base/logging.h"
13 #include "base/memory/ptr_util.h" 13 #include "base/memory/ptr_util.h"
14 #include "base/rand_util.h" 14 #include "base/rand_util.h"
15 #include "net/spdy/core/hpack/hpack_constants.h" 15 #include "net/spdy/core/hpack/hpack_constants.h"
16 #include "net/spdy/core/mock_spdy_framer_visitor.h" 16 #include "net/spdy/core/mock_spdy_framer_visitor.h"
17 #include "net/spdy/core/spdy_frame_builder.h" 17 #include "net/spdy/core/spdy_frame_builder.h"
18 #include "net/spdy/core/spdy_frame_reader.h" 18 #include "net/spdy/core/spdy_frame_reader.h"
19 #include "net/spdy/core/spdy_protocol.h" 19 #include "net/spdy/core/spdy_protocol.h"
20 #include "net/spdy/core/spdy_protocol_test_utils.h" 20 #include "net/spdy/core/spdy_protocol_test_utils.h"
21 #include "net/spdy/core/spdy_test_utils.h" 21 #include "net/spdy/core/spdy_test_utils.h"
22 22 #include "net/spdy/platform/api/spdy_ptr_util.h"
23 using ::base::MakeUnique;
24 23
25 namespace net { 24 namespace net {
26 namespace test { 25 namespace test {
27 namespace { 26 namespace {
28 27
29 class SpdyDeframerVisitorTest : public ::testing::Test { 28 class SpdyDeframerVisitorTest : public ::testing::Test {
30 protected: 29 protected:
31 SpdyDeframerVisitorTest() 30 SpdyDeframerVisitorTest()
32 : encoder_(SpdyFramer::ENABLE_COMPRESSION), 31 : encoder_(SpdyFramer::ENABLE_COMPRESSION),
33 decoder_(SpdyFramer::ENABLE_COMPRESSION) { 32 decoder_(SpdyFramer::ENABLE_COMPRESSION) {
34 decoder_.set_process_single_input_frame(true); 33 decoder_.set_process_single_input_frame(true);
35 auto collector = MakeUnique<DeframerCallbackCollector>(&collected_frames_); 34 auto collector =
35 SpdyMakeUnique<DeframerCallbackCollector>(&collected_frames_);
36 auto log_and_collect = 36 auto log_and_collect =
37 SpdyDeframerVisitorInterface::LogBeforeVisiting(std::move(collector)); 37 SpdyDeframerVisitorInterface::LogBeforeVisiting(std::move(collector));
38 deframer_ = SpdyTestDeframer::CreateConverter(std::move(log_and_collect)); 38 deframer_ = SpdyTestDeframer::CreateConverter(std::move(log_and_collect));
39 decoder_.set_visitor(deframer_.get()); 39 decoder_.set_visitor(deframer_.get());
40 } 40 }
41 41
42 bool DeframeInput(const char* input, size_t size) { 42 bool DeframeInput(const char* input, size_t size) {
43 size_t input_remaining = size; 43 size_t input_remaining = size;
44 while (input_remaining > 0 && 44 while (input_remaining > 0 &&
45 decoder_.spdy_framer_error() == SpdyFramer::SPDY_NO_ERROR) { 45 decoder_.spdy_framer_error() == SpdyFramer::SPDY_NO_ERROR) {
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 // TODO(jamessynge): Please implement. 262 // TODO(jamessynge): Please implement.
263 } 263 }
264 264
265 TEST_F(SpdyDeframerVisitorTest, DISABLED_AltSvcFrame) { 265 TEST_F(SpdyDeframerVisitorTest, DISABLED_AltSvcFrame) {
266 // TODO(jamessynge): Please implement. 266 // TODO(jamessynge): Please implement.
267 } 267 }
268 268
269 } // namespace 269 } // namespace
270 } // namespace test 270 } // namespace test
271 } // namespace net 271 } // namespace net
OLDNEW
« no previous file with comments | « net/spdy/core/spdy_deframer_visitor.cc ('k') | net/spdy/core/spdy_frame_builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698