| OLD | NEW |
| 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 | |
| 7 #include "net/quic/crypto/crypto_framer.h" | 6 #include "net/quic/crypto/crypto_framer.h" |
| 8 | 7 |
| 9 using std::max; | 8 using std::max; |
| 10 using std::min; | 9 using std::min; |
| 11 using std::string; | 10 using std::string; |
| 12 | 11 |
| 13 namespace net { | 12 namespace net { |
| 14 namespace test { | 13 namespace test { |
| 15 | 14 |
| 16 MockFramerVisitor::MockFramerVisitor() { | 15 MockFramerVisitor::MockFramerVisitor() { |
| (...skipping 11 matching lines...) Expand all Loading... |
| 28 bool FramerVisitorCapturingAcks::OnPacketHeader( | 27 bool FramerVisitorCapturingAcks::OnPacketHeader( |
| 29 const QuicPacketHeader& header) { | 28 const QuicPacketHeader& header) { |
| 30 header_ = header; | 29 header_ = header; |
| 31 return true; | 30 return true; |
| 32 } | 31 } |
| 33 | 32 |
| 34 void FramerVisitorCapturingAcks::OnAckFrame(const QuicAckFrame& frame) { | 33 void FramerVisitorCapturingAcks::OnAckFrame(const QuicAckFrame& frame) { |
| 35 frame_ = frame; | 34 frame_ = frame; |
| 36 } | 35 } |
| 37 | 36 |
| 38 MockHelper::MockHelper() { | |
| 39 } | |
| 40 | |
| 41 MockHelper::~MockHelper() { | |
| 42 } | |
| 43 | |
| 44 QuicClock* MockHelper::GetClock() { | |
| 45 return &clock_; | |
| 46 } | |
| 47 | |
| 48 MockConnectionVisitor::MockConnectionVisitor() { | 37 MockConnectionVisitor::MockConnectionVisitor() { |
| 49 } | 38 } |
| 50 | 39 |
| 51 MockConnectionVisitor::~MockConnectionVisitor() { | 40 MockConnectionVisitor::~MockConnectionVisitor() { |
| 52 } | 41 } |
| 53 | 42 |
| 54 MockScheduler::MockScheduler() | 43 MockScheduler::MockScheduler() |
| 55 : QuicSendScheduler(NULL, kFixRate) { | 44 : QuicSendScheduler(NULL, kFixRate) { |
| 56 } | 45 } |
| 57 | 46 |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 data->AsStringPiece()); | 149 data->AsStringPiece()); |
| 161 | 150 |
| 162 QuicFrame frame(&stream_frame); | 151 QuicFrame frame(&stream_frame); |
| 163 QuicFrames frames; | 152 QuicFrames frames; |
| 164 frames.push_back(frame); | 153 frames.push_back(frame); |
| 165 QuicPacket* packet; | 154 QuicPacket* packet; |
| 166 quic_framer.ConstructFragementDataPacket(header, frames, &packet); | 155 quic_framer.ConstructFragementDataPacket(header, frames, &packet); |
| 167 return packet; | 156 return packet; |
| 168 } | 157 } |
| 169 | 158 |
| 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 | |
| 200 } // namespace test | 159 } // namespace test |
| 201 | 160 |
| 202 } // namespace net | 161 } // namespace net |
| OLD | NEW |