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 | 6 |
| 7 #include "base/stl_util.h" |
7 #include "net/quic/crypto/crypto_framer.h" | 8 #include "net/quic/crypto/crypto_framer.h" |
8 | 9 |
9 using std::max; | 10 using std::max; |
10 using std::min; | 11 using std::min; |
11 using std::string; | 12 using std::string; |
12 using testing::_; | 13 using testing::_; |
13 | 14 |
14 namespace net { | 15 namespace net { |
15 namespace test { | 16 namespace test { |
16 | 17 |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 | 83 |
83 MockConnection::~MockConnection() { | 84 MockConnection::~MockConnection() { |
84 } | 85 } |
85 | 86 |
86 PacketSavingConnection::PacketSavingConnection(QuicGuid guid, | 87 PacketSavingConnection::PacketSavingConnection(QuicGuid guid, |
87 IPEndPoint address) | 88 IPEndPoint address) |
88 : MockConnection(guid, address) { | 89 : MockConnection(guid, address) { |
89 } | 90 } |
90 | 91 |
91 PacketSavingConnection::~PacketSavingConnection() { | 92 PacketSavingConnection::~PacketSavingConnection() { |
| 93 STLDeleteElements(&packets_); |
92 } | 94 } |
93 | 95 |
94 bool PacketSavingConnection::SendPacket(QuicPacketSequenceNumber number, | 96 bool PacketSavingConnection::SendPacket(QuicPacketSequenceNumber number, |
95 QuicPacket* packet, | 97 QuicPacket* packet, |
96 bool should_resend, | 98 bool should_resend, |
97 bool force, | 99 bool force, |
98 bool is_retransmit) { | 100 bool is_retransmit) { |
99 packets_.push_back(packet); | 101 packets_.push_back(packet); |
100 return true; | 102 return true; |
101 } | 103 } |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 data->AsStringPiece()); | 211 data->AsStringPiece()); |
210 | 212 |
211 QuicFrame frame(&stream_frame); | 213 QuicFrame frame(&stream_frame); |
212 QuicFrames frames; | 214 QuicFrames frames; |
213 frames.push_back(frame); | 215 frames.push_back(frame); |
214 return quic_framer.ConstructFrameDataPacket(header, frames); | 216 return quic_framer.ConstructFrameDataPacket(header, frames); |
215 } | 217 } |
216 | 218 |
217 } // namespace test | 219 } // namespace test |
218 } // namespace net | 220 } // namespace net |
OLD | NEW |