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 "base/stl_util.h" |
8 #include "net/quic/crypto/crypto_framer.h" | 8 #include "net/quic/crypto/crypto_framer.h" |
9 #include "net/quic/crypto/crypto_handshake.h" | 9 #include "net/quic/crypto/crypto_handshake.h" |
10 #include "net/quic/crypto/crypto_utils.h" | 10 #include "net/quic/crypto/crypto_utils.h" |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 QuicPacketEntropyHash entropy_hash, | 228 QuicPacketEntropyHash entropy_hash, |
229 HasRetransmittableData retransmittable) { | 229 HasRetransmittableData retransmittable) { |
230 packets_.push_back(packet); | 230 packets_.push_back(packet); |
231 QuicEncryptedPacket* encrypted = | 231 QuicEncryptedPacket* encrypted = |
232 framer_.EncryptPacket(level, sequence_number, *packet); | 232 framer_.EncryptPacket(level, sequence_number, *packet); |
233 encrypted_packets_.push_back(encrypted); | 233 encrypted_packets_.push_back(encrypted); |
234 return true; | 234 return true; |
235 } | 235 } |
236 | 236 |
237 MockSession::MockSession(QuicConnection* connection, bool is_server) | 237 MockSession::MockSession(QuicConnection* connection, bool is_server) |
238 : QuicSession(connection, is_server) { | 238 : QuicSession(connection, QuicConfig(), is_server) { |
239 ON_CALL(*this, WriteData(_, _, _, _)) | 239 ON_CALL(*this, WriteData(_, _, _, _)) |
240 .WillByDefault(testing::Return(QuicConsumedData(0, false))); | 240 .WillByDefault(testing::Return(QuicConsumedData(0, false))); |
241 } | 241 } |
242 | 242 |
243 MockSession::~MockSession() { | 243 MockSession::~MockSession() { |
244 } | 244 } |
245 | 245 |
246 TestSession::TestSession(QuicConnection* connection, bool is_server) | 246 TestSession::TestSession(QuicConnection* connection, |
247 : QuicSession(connection, is_server), | 247 const QuicConfig& config, |
| 248 bool is_server) |
| 249 : QuicSession(connection, config, is_server), |
248 crypto_stream_(NULL) { | 250 crypto_stream_(NULL) { |
249 } | 251 } |
250 | 252 |
251 TestSession::~TestSession() { | 253 TestSession::~TestSession() { |
252 } | 254 } |
253 | 255 |
254 void TestSession::SetCryptoStream(QuicCryptoStream* stream) { | 256 void TestSession::SetCryptoStream(QuicCryptoStream* stream) { |
255 crypto_stream_ = stream; | 257 crypto_stream_ = stream; |
256 } | 258 } |
257 | 259 |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
397 QuicPacketEntropyHash TestEntropyCalculator::ReceivedEntropyHash( | 399 QuicPacketEntropyHash TestEntropyCalculator::ReceivedEntropyHash( |
398 QuicPacketSequenceNumber sequence_number) const { | 400 QuicPacketSequenceNumber sequence_number) const { |
399 return 1u; | 401 return 1u; |
400 } | 402 } |
401 | 403 |
402 bool TestDecompressorVisitor::OnDecompressedData(StringPiece data) { | 404 bool TestDecompressorVisitor::OnDecompressedData(StringPiece data) { |
403 data.AppendToString(&data_); | 405 data.AppendToString(&data_); |
404 return true; | 406 return true; |
405 } | 407 } |
406 | 408 |
| 409 void TestDecompressorVisitor::OnDecompressionError() { |
| 410 error_ = true; |
| 411 } |
| 412 |
407 } // namespace test | 413 } // namespace test |
408 } // namespace net | 414 } // namespace net |
OLD | NEW |