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

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

Issue 1499163002: Fix ASAN test failure in QUIC's CryptoHandshakeMessageTest (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@108754896
Patch Set: Created 5 years 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
« no previous file with comments | « net/quic/test_tools/quic_test_utils.h ('k') | net/tools/quic/quic_spdy_server_stream_test.cc » ('j') | 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
7 #include "base/sha1.h" 7 #include "base/sha1.h"
8 #include "base/stl_util.h" 8 #include "base/stl_util.h"
9 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "net/quic/crypto/crypto_framer.h" 10 #include "net/quic/crypto/crypto_framer.h"
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 MockQuicSpdySession::MockQuicSpdySession(QuicConnection* connection) 318 MockQuicSpdySession::MockQuicSpdySession(QuicConnection* connection)
319 : QuicSpdySession(connection, DefaultQuicConfig()) { 319 : QuicSpdySession(connection, DefaultQuicConfig()) {
320 crypto_stream_.reset(new QuicCryptoStream(this)); 320 crypto_stream_.reset(new QuicCryptoStream(this));
321 Initialize(); 321 Initialize();
322 ON_CALL(*this, WritevData(_, _, _, _, _, _)) 322 ON_CALL(*this, WritevData(_, _, _, _, _, _))
323 .WillByDefault(testing::Return(QuicConsumedData(0, false))); 323 .WillByDefault(testing::Return(QuicConsumedData(0, false)));
324 } 324 }
325 325
326 MockQuicSpdySession::~MockQuicSpdySession() {} 326 MockQuicSpdySession::~MockQuicSpdySession() {}
327 327
328 // static
329 QuicConsumedData MockQuicSpdySession::ConsumeAllData(
330 QuicStreamId /*id*/,
331 const QuicIOVector& data,
332 QuicStreamOffset /*offset*/,
333 bool fin,
334 FecProtection /*fec_protection*/,
335 QuicAckListenerInterface* /*ack_notifier_delegate*/) {
336 return QuicConsumedData(data.total_length, fin);
337 }
338
328 TestQuicSpdyServerSession::TestQuicSpdyServerSession( 339 TestQuicSpdyServerSession::TestQuicSpdyServerSession(
329 QuicConnection* connection, 340 QuicConnection* connection,
330 const QuicConfig& config, 341 const QuicConfig& config,
331 const QuicCryptoServerConfig* crypto_config) 342 const QuicCryptoServerConfig* crypto_config)
332 : QuicServerSession(config, connection, &visitor_, crypto_config) { 343 : QuicServerSession(config, connection, &visitor_, crypto_config) {
333 Initialize(); 344 Initialize();
334 } 345 }
335 346
336 TestQuicSpdyServerSession::~TestQuicSpdyServerSession() {} 347 TestQuicSpdyServerSession::~TestQuicSpdyServerSession() {}
337 348
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after
802 // strike register worries that we've just overflowed a uint32 time. 813 // strike register worries that we've just overflowed a uint32 time.
803 (*server_connection)->AdvanceTime(connection_start_time); 814 (*server_connection)->AdvanceTime(connection_start_time);
804 } 815 }
805 816
806 QuicStreamId QuicClientDataStreamId(int i) { 817 QuicStreamId QuicClientDataStreamId(int i) {
807 return kClientDataStreamId1 + 2 * i; 818 return kClientDataStreamId1 + 2 * i;
808 } 819 }
809 820
810 } // namespace test 821 } // namespace test
811 } // namespace net 822 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/test_tools/quic_test_utils.h ('k') | net/tools/quic/quic_spdy_server_stream_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698