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

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: Fix 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 21 matching lines...) Expand all
32 connection_(new PacketSavingConnection(guid_, IPEndPoint(), false)), 32 connection_(new PacketSavingConnection(guid_, IPEndPoint(), false)),
33 session_(connection_, scoped_ptr<DatagramClientSocket>(), NULL, 33 session_(connection_, scoped_ptr<DatagramClientSocket>(), NULL,
34 NULL, kServerHostname, DefaultQuicConfig(), &crypto_config_, 34 NULL, kServerHostname, DefaultQuicConfig(), &crypto_config_,
35 &net_log_) { 35 &net_log_) {
36 session_.config()->SetDefaults(); 36 session_.config()->SetDefaults();
37 crypto_config_.SetDefaults(); 37 crypto_config_.SetDefaults();
38 } 38 }
39 39
40 void CompleteCryptoHandshake() { 40 void CompleteCryptoHandshake() {
41 ASSERT_EQ(ERR_IO_PENDING, 41 ASSERT_EQ(ERR_IO_PENDING,
42 session_.CryptoConnect(callback_.callback())); 42 session_.CryptoConnect(false, callback_.callback()));
43 CryptoTestUtils::HandshakeWithFakeServer( 43 CryptoTestUtils::HandshakeWithFakeServer(
44 connection_, session_.GetCryptoStream()); 44 connection_, session_.GetCryptoStream());
45 ASSERT_EQ(OK, callback_.WaitForResult()); 45 ASSERT_EQ(OK, callback_.WaitForResult());
46 } 46 }
47 47
48 QuicGuid guid_; 48 QuicGuid guid_;
49 PacketSavingConnection* connection_; 49 PacketSavingConnection* connection_;
50 CapturingNetLog net_log_; 50 CapturingNetLog net_log_;
51 QuicClientSession session_; 51 QuicClientSession session_;
52 MockClock clock_; 52 MockClock clock_;
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 125
126 // After receiving a GoAway, I should no longer be able to create outgoing 126 // After receiving a GoAway, I should no longer be able to create outgoing
127 // streams. 127 // streams.
128 session_.OnGoAway(QuicGoAwayFrame(QUIC_PEER_GOING_AWAY, 1u, "Going away.")); 128 session_.OnGoAway(QuicGoAwayFrame(QUIC_PEER_GOING_AWAY, 1u, "Going away."));
129 EXPECT_EQ(NULL, session_.CreateOutgoingReliableStream()); 129 EXPECT_EQ(NULL, session_.CreateOutgoingReliableStream());
130 } 130 }
131 131
132 } // namespace 132 } // namespace
133 } // namespace test 133 } // namespace test
134 } // namespace net 134 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698