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

Side by Side Diff: net/quic/test_tools/quic_test_utils.cc

Issue 123303003: Move all the packet parsing logic into QuicDispatcher from the (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « net/quic/test_tools/quic_test_utils.h ('k') | net/quic/test_tools/simple_quic_framer.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 (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/quic/test_tools/quic_test_utils.h" 5 #include "net/quic/test_tools/quic_test_utils.h"
6 6
7 #include "base/stl_util.h" 7 #include "base/stl_util.h"
8 #include "base/strings/string_number_conversions.h" 8 #include "base/strings/string_number_conversions.h"
9 #include "net/quic/crypto/crypto_framer.h" 9 #include "net/quic/crypto/crypto_framer.h"
10 #include "net/quic/crypto/crypto_handshake.h" 10 #include "net/quic/crypto/crypto_handshake.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 42
43 MockFramerVisitor::MockFramerVisitor() { 43 MockFramerVisitor::MockFramerVisitor() {
44 // By default, we want to accept packets. 44 // By default, we want to accept packets.
45 ON_CALL(*this, OnProtocolVersionMismatch(_)) 45 ON_CALL(*this, OnProtocolVersionMismatch(_))
46 .WillByDefault(testing::Return(false)); 46 .WillByDefault(testing::Return(false));
47 47
48 // By default, we want to accept packets. 48 // By default, we want to accept packets.
49 ON_CALL(*this, OnUnauthenticatedHeader(_)) 49 ON_CALL(*this, OnUnauthenticatedHeader(_))
50 .WillByDefault(testing::Return(true)); 50 .WillByDefault(testing::Return(true));
51 51
52 ON_CALL(*this, OnUnauthenticatedPublicHeader(_))
53 .WillByDefault(testing::Return(true));
54
52 ON_CALL(*this, OnPacketHeader(_)) 55 ON_CALL(*this, OnPacketHeader(_))
53 .WillByDefault(testing::Return(true)); 56 .WillByDefault(testing::Return(true));
54 57
55 ON_CALL(*this, OnStreamFrame(_)) 58 ON_CALL(*this, OnStreamFrame(_))
56 .WillByDefault(testing::Return(true)); 59 .WillByDefault(testing::Return(true));
57 60
58 ON_CALL(*this, OnAckFrame(_)) 61 ON_CALL(*this, OnAckFrame(_))
59 .WillByDefault(testing::Return(true)); 62 .WillByDefault(testing::Return(true));
60 63
61 ON_CALL(*this, OnCongestionFeedbackFrame(_)) 64 ON_CALL(*this, OnCongestionFeedbackFrame(_))
62 .WillByDefault(testing::Return(true)); 65 .WillByDefault(testing::Return(true));
63 66
64 ON_CALL(*this, OnRstStreamFrame(_)) 67 ON_CALL(*this, OnRstStreamFrame(_))
65 .WillByDefault(testing::Return(true)); 68 .WillByDefault(testing::Return(true));
66 69
67 ON_CALL(*this, OnConnectionCloseFrame(_)) 70 ON_CALL(*this, OnConnectionCloseFrame(_))
68 .WillByDefault(testing::Return(true)); 71 .WillByDefault(testing::Return(true));
69 72
70 ON_CALL(*this, OnGoAwayFrame(_)) 73 ON_CALL(*this, OnGoAwayFrame(_))
71 .WillByDefault(testing::Return(true)); 74 .WillByDefault(testing::Return(true));
72 } 75 }
73 76
74 MockFramerVisitor::~MockFramerVisitor() { 77 MockFramerVisitor::~MockFramerVisitor() {
75 } 78 }
76 79
77 bool NoOpFramerVisitor::OnProtocolVersionMismatch(QuicVersion version) { 80 bool NoOpFramerVisitor::OnProtocolVersionMismatch(QuicVersion version) {
78 return false; 81 return false;
79 } 82 }
80 83
84 bool NoOpFramerVisitor::OnUnauthenticatedPublicHeader(
85 const QuicPacketPublicHeader& header) {
86 return true;
87 }
88
81 bool NoOpFramerVisitor::OnUnauthenticatedHeader( 89 bool NoOpFramerVisitor::OnUnauthenticatedHeader(
82 const QuicPacketHeader& header) { 90 const QuicPacketHeader& header) {
83 return true; 91 return true;
84 } 92 }
85 93
86 bool NoOpFramerVisitor::OnPacketHeader(const QuicPacketHeader& header) { 94 bool NoOpFramerVisitor::OnPacketHeader(const QuicPacketHeader& header) {
87 return true; 95 return true;
88 } 96 }
89 97
90 bool NoOpFramerVisitor::OnStreamFrame(const QuicStreamFrame& frame) { 98 bool NoOpFramerVisitor::OnStreamFrame(const QuicStreamFrame& frame) {
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after
538 data.AppendToString(&data_); 546 data.AppendToString(&data_);
539 return true; 547 return true;
540 } 548 }
541 549
542 void TestDecompressorVisitor::OnDecompressionError() { 550 void TestDecompressorVisitor::OnDecompressionError() {
543 error_ = true; 551 error_ = true;
544 } 552 }
545 553
546 } // namespace test 554 } // namespace test
547 } // namespace net 555 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/test_tools/quic_test_utils.h ('k') | net/quic/test_tools/simple_quic_framer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698