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

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

Issue 11367082: Add QuicStream and friends to QUIC code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix Created 8 years, 1 month 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') | no next file » | 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 #include "net/quic/crypto/crypto_framer.h" 7 #include "net/quic/crypto/crypto_framer.h"
7 8
8 using std::max; 9 using std::max;
9 using std::min; 10 using std::min;
10 using std::string; 11 using std::string;
11 12
12 namespace net { 13 namespace net {
13 namespace test { 14 namespace test {
14 15
15 MockFramerVisitor::MockFramerVisitor() { 16 MockFramerVisitor::MockFramerVisitor() {
(...skipping 11 matching lines...) Expand all
27 bool FramerVisitorCapturingAcks::OnPacketHeader( 28 bool FramerVisitorCapturingAcks::OnPacketHeader(
28 const QuicPacketHeader& header) { 29 const QuicPacketHeader& header) {
29 header_ = header; 30 header_ = header;
30 return true; 31 return true;
31 } 32 }
32 33
33 void FramerVisitorCapturingAcks::OnAckFrame(const QuicAckFrame& frame) { 34 void FramerVisitorCapturingAcks::OnAckFrame(const QuicAckFrame& frame) {
34 frame_ = frame; 35 frame_ = frame;
35 } 36 }
36 37
38 MockHelper::MockHelper() {
39 }
40
41 MockHelper::~MockHelper() {
42 }
43
44 QuicClock* MockHelper::GetClock() {
45 return &clock_;
46 }
47
37 MockConnectionVisitor::MockConnectionVisitor() { 48 MockConnectionVisitor::MockConnectionVisitor() {
38 } 49 }
39 50
40 MockConnectionVisitor::~MockConnectionVisitor() { 51 MockConnectionVisitor::~MockConnectionVisitor() {
41 } 52 }
42 53
43 MockScheduler::MockScheduler() 54 MockScheduler::MockScheduler()
44 : QuicSendScheduler(NULL, kFixRate) { 55 : QuicSendScheduler(NULL, kFixRate) {
45 } 56 }
46 57
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 data->AsStringPiece()); 160 data->AsStringPiece());
150 161
151 QuicFrame frame(&stream_frame); 162 QuicFrame frame(&stream_frame);
152 QuicFrames frames; 163 QuicFrames frames;
153 frames.push_back(frame); 164 frames.push_back(frame);
154 QuicPacket* packet; 165 QuicPacket* packet;
155 quic_framer.ConstructFragementDataPacket(header, frames, &packet); 166 quic_framer.ConstructFragementDataPacket(header, frames, &packet);
156 return packet; 167 return packet;
157 } 168 }
158 169
170 MockConnection::MockConnection(QuicGuid guid, IPEndPoint address)
171 : QuicConnection(guid, address, new MockHelper()) {
172 }
173
174 MockConnection::~MockConnection() {
175 }
176
177 PacketSavingConnection::PacketSavingConnection(QuicGuid guid,
178 IPEndPoint address)
179 : MockConnection(guid, address) {
180 }
181
182 PacketSavingConnection::~PacketSavingConnection() {
183 }
184
185 bool PacketSavingConnection::SendPacket(QuicPacketSequenceNumber number,
186 QuicPacket* packet,
187 bool resend,
188 bool force) {
189 packets_.push_back(packet);
190 return true;
191 }
192
193 MockSession::MockSession(QuicConnection* connection, bool is_server)
194 : QuicSession(connection, is_server) {
195 }
196
197 MockSession::~MockSession() {
198 }
199
159 } // namespace test 200 } // namespace test
160 201
161 } // namespace net 202 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/test_tools/quic_test_utils.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698