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 "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 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 EncryptionLevel level, | 282 EncryptionLevel level, |
283 const SerializedPacket& packet, | 283 const SerializedPacket& packet, |
284 TransmissionType transmission_type) { | 284 TransmissionType transmission_type) { |
285 packets_.push_back(packet.packet); | 285 packets_.push_back(packet.packet); |
286 QuicEncryptedPacket* encrypted = | 286 QuicEncryptedPacket* encrypted = |
287 framer_.EncryptPacket(level, packet.sequence_number, *packet.packet); | 287 framer_.EncryptPacket(level, packet.sequence_number, *packet.packet); |
288 encrypted_packets_.push_back(encrypted); | 288 encrypted_packets_.push_back(encrypted); |
289 return true; | 289 return true; |
290 } | 290 } |
291 | 291 |
292 MockSession::MockSession(QuicConnection* connection, bool is_server) | 292 MockSession::MockSession(QuicConnection* connection) |
293 : QuicSession(connection, DefaultQuicConfig(), is_server) { | 293 : QuicSession(connection, DefaultQuicConfig()) { |
294 ON_CALL(*this, WritevData(_, _, _, _, _, _)) | 294 ON_CALL(*this, WritevData(_, _, _, _, _, _)) |
295 .WillByDefault(testing::Return(QuicConsumedData(0, false))); | 295 .WillByDefault(testing::Return(QuicConsumedData(0, false))); |
296 } | 296 } |
297 | 297 |
298 MockSession::~MockSession() { | 298 MockSession::~MockSession() { |
299 } | 299 } |
300 | 300 |
301 TestSession::TestSession(QuicConnection* connection, | 301 TestSession::TestSession(QuicConnection* connection, |
302 const QuicConfig& config) | 302 const QuicConfig& config) |
303 : QuicSession(connection, config, connection->is_server()), | 303 : QuicSession(connection, config), |
304 crypto_stream_(NULL) { | 304 crypto_stream_(NULL) { |
305 } | 305 } |
306 | 306 |
307 TestSession::~TestSession() {} | 307 TestSession::~TestSession() {} |
308 | 308 |
309 void TestSession::SetCryptoStream(QuicCryptoStream* stream) { | 309 void TestSession::SetCryptoStream(QuicCryptoStream* stream) { |
310 crypto_stream_ = stream; | 310 crypto_stream_ = stream; |
311 } | 311 } |
312 | 312 |
313 QuicCryptoStream* TestSession::GetCryptoStream() { | 313 QuicCryptoStream* TestSession::GetCryptoStream() { |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
516 data.AppendToString(&data_); | 516 data.AppendToString(&data_); |
517 return true; | 517 return true; |
518 } | 518 } |
519 | 519 |
520 void TestDecompressorVisitor::OnDecompressionError() { | 520 void TestDecompressorVisitor::OnDecompressionError() { |
521 error_ = true; | 521 error_ = true; |
522 } | 522 } |
523 | 523 |
524 } // namespace test | 524 } // namespace test |
525 } // namespace net | 525 } // namespace net |
OLD | NEW |