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

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

Issue 11364068: Add a QuicHttpStream class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix bugs Created 8 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 | 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 "base/stl_util.h" 9 #include "base/stl_util.h"
10 #include "net/base/test_completion_callback.h" 10 #include "net/base/test_completion_callback.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 // Initialize crypto before the client session will create a stream. 53 // Initialize crypto before the client session will create a stream.
54 session_.CryptoConnect(callback_.callback()); 54 session_.CryptoConnect(callback_.callback());
55 CryptoHandshakeMessage server_message; 55 CryptoHandshakeMessage server_message;
56 server_message.tag = kSHLO; 56 server_message.tag = kSHLO;
57 session_.GetCryptoStream()->OnHandshakeMessage(server_message); 57 session_.GetCryptoStream()->OnHandshakeMessage(server_message);
58 callback_.WaitForResult(); 58 callback_.WaitForResult();
59 59
60 std::vector<QuicReliableClientStream*> streams; 60 std::vector<QuicReliableClientStream*> streams;
61 for (size_t i = 0; i < kDefaultMaxStreamsPerConnection; i++) { 61 for (size_t i = 0; i < kDefaultMaxStreamsPerConnection; i++) {
62 QuicReliableClientStream* stream = session_.CreateOutgoingReliableStream(); 62 QuicReliableClientStream* stream = session_.CreateOutgoingReliableStream();
63 EXPECT_TRUE(stream);
63 streams.push_back(stream); 64 streams.push_back(stream);
64 EXPECT_TRUE(stream);
65 } 65 }
66 EXPECT_FALSE(session_.CreateOutgoingReliableStream()); 66 EXPECT_FALSE(session_.CreateOutgoingReliableStream());
67 67
68 // Close a stream and ensure I can now open a new one. 68 // Close a stream and ensure I can now open a new one.
69 session_.CloseStream(streams[0]->id()); 69 session_.CloseStream(streams[0]->id());
70 scoped_ptr<QuicReliableClientStream> stream( 70 EXPECT_TRUE(session_.CreateOutgoingReliableStream());
willchan no longer on Chromium 2012/11/21 22:50:03 Is this just leaking?
Ryan Hamilton 2012/11/21 23:06:35 No, the stream is owned by the session.
71 session_.CreateOutgoingReliableStream());
72 EXPECT_TRUE(stream.get());
73 STLDeleteElements(&streams);
74 } 71 }
75 72
76 } // namespace 73 } // namespace
77 } // namespace test 74 } // namespace test
78 } // namespace net 75 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698