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

Side by Side Diff: net/quic/quic_client_session_test.cc

Issue 23279011: Require handshake confirmation until a QUIC connection is created succesfully when using a new netw… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added test Created 7 years, 4 months 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 | Annotate | Revision Log
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/quic_client_session.h" 5 #include "net/quic/quic_client_session.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "net/base/capturing_net_log.h" 9 #include "net/base/capturing_net_log.h"
10 #include "net/base/test_completion_callback.h" 10 #include "net/base/test_completion_callback.h"
(...skipping 19 matching lines...) Expand all
30 : guid_(1), 30 : guid_(1),
31 connection_(new PacketSavingConnection(guid_, IPEndPoint(), false)), 31 connection_(new PacketSavingConnection(guid_, IPEndPoint(), false)),
32 session_(connection_, NULL, NULL, NULL, kServerHostname, 32 session_(connection_, NULL, NULL, NULL, kServerHostname,
33 DefaultQuicConfig(), &crypto_config_, &net_log_) { 33 DefaultQuicConfig(), &crypto_config_, &net_log_) {
34 session_.config()->SetDefaults(); 34 session_.config()->SetDefaults();
35 crypto_config_.SetDefaults(); 35 crypto_config_.SetDefaults();
36 } 36 }
37 37
38 void CompleteCryptoHandshake() { 38 void CompleteCryptoHandshake() {
39 ASSERT_EQ(ERR_IO_PENDING, 39 ASSERT_EQ(ERR_IO_PENDING,
40 session_.CryptoConnect(callback_.callback())); 40 session_.CryptoConnect(false, callback_.callback()));
41 CryptoTestUtils::HandshakeWithFakeServer( 41 CryptoTestUtils::HandshakeWithFakeServer(
42 connection_, session_.GetCryptoStream()); 42 connection_, session_.GetCryptoStream());
43 ASSERT_EQ(OK, callback_.WaitForResult()); 43 ASSERT_EQ(OK, callback_.WaitForResult());
44 } 44 }
45 45
46 QuicGuid guid_; 46 QuicGuid guid_;
47 PacketSavingConnection* connection_; 47 PacketSavingConnection* connection_;
48 CapturingNetLog net_log_; 48 CapturingNetLog net_log_;
49 QuicClientSession session_; 49 QuicClientSession session_;
50 MockClock clock_; 50 MockClock clock_;
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 123
124 // After receiving a GoAway, I should no longer be able to create outgoing 124 // After receiving a GoAway, I should no longer be able to create outgoing
125 // streams. 125 // streams.
126 session_.OnGoAway(QuicGoAwayFrame(QUIC_PEER_GOING_AWAY, 1u, "Going away.")); 126 session_.OnGoAway(QuicGoAwayFrame(QUIC_PEER_GOING_AWAY, 1u, "Going away."));
127 EXPECT_EQ(NULL, session_.CreateOutgoingReliableStream()); 127 EXPECT_EQ(NULL, session_.CreateOutgoingReliableStream());
128 } 128 }
129 129
130 } // namespace 130 } // namespace
131 } // namespace test 131 } // namespace test
132 } // namespace net 132 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698