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

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

Issue 1651153005: changes QUIC negotiation about max open streams which effects server (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@113042237
Patch Set: Created 4 years, 10 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
« no previous file with comments | « net/quic/quic_chromium_client_session.cc ('k') | net/quic/quic_client_session_base.h » ('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/quic_chromium_client_session.h" 5 #include "net/quic/quic_chromium_client_session.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/base64.h" 9 #include "base/base64.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 MockRead reads[] = {MockRead(SYNCHRONOUS, ERR_IO_PENDING, 0)}; 148 MockRead reads[] = {MockRead(SYNCHRONOUS, ERR_IO_PENDING, 0)};
149 scoped_ptr<QuicEncryptedPacket> client_rst(maker_.MakeRstPacket( 149 scoped_ptr<QuicEncryptedPacket> client_rst(maker_.MakeRstPacket(
150 1, true, kClientDataStreamId1, QUIC_RST_ACKNOWLEDGEMENT)); 150 1, true, kClientDataStreamId1, QUIC_RST_ACKNOWLEDGEMENT));
151 MockWrite writes[] = { 151 MockWrite writes[] = {
152 MockWrite(ASYNC, client_rst->data(), client_rst->length(), 1)}; 152 MockWrite(ASYNC, client_rst->data(), client_rst->length(), 1)};
153 socket_data_.reset(new SequencedSocketData(reads, arraysize(reads), writes, 153 socket_data_.reset(new SequencedSocketData(reads, arraysize(reads), writes,
154 arraysize(writes))); 154 arraysize(writes)));
155 155
156 Initialize(); 156 Initialize();
157 CompleteCryptoHandshake(); 157 CompleteCryptoHandshake();
158 const size_t kMaxOpenStreams = session_->get_max_open_streams(); 158 const size_t kMaxOpenStreams = session_->max_open_outgoing_streams();
159 159
160 std::vector<QuicChromiumClientStream*> streams; 160 std::vector<QuicChromiumClientStream*> streams;
161 for (size_t i = 0; i < kMaxOpenStreams; i++) { 161 for (size_t i = 0; i < kMaxOpenStreams; i++) {
162 QuicChromiumClientStream* stream = 162 QuicChromiumClientStream* stream =
163 session_->CreateOutgoingDynamicStream(kDefaultPriority); 163 session_->CreateOutgoingDynamicStream(kDefaultPriority);
164 EXPECT_TRUE(stream); 164 EXPECT_TRUE(stream);
165 streams.push_back(stream); 165 streams.push_back(stream);
166 } 166 }
167 EXPECT_FALSE(session_->CreateOutgoingDynamicStream(kDefaultPriority)); 167 EXPECT_FALSE(session_->CreateOutgoingDynamicStream(kDefaultPriority));
168 168
(...skipping 14 matching lines...) Expand all
183 MockRead reads[] = {MockRead(SYNCHRONOUS, ERR_IO_PENDING, 0)}; 183 MockRead reads[] = {MockRead(SYNCHRONOUS, ERR_IO_PENDING, 0)};
184 scoped_ptr<QuicEncryptedPacket> client_rst(maker_.MakeRstPacket( 184 scoped_ptr<QuicEncryptedPacket> client_rst(maker_.MakeRstPacket(
185 1, true, kClientDataStreamId1, QUIC_RST_ACKNOWLEDGEMENT)); 185 1, true, kClientDataStreamId1, QUIC_RST_ACKNOWLEDGEMENT));
186 MockWrite writes[] = { 186 MockWrite writes[] = {
187 MockWrite(ASYNC, client_rst->data(), client_rst->length(), 1)}; 187 MockWrite(ASYNC, client_rst->data(), client_rst->length(), 1)};
188 socket_data_.reset(new SequencedSocketData(reads, arraysize(reads), writes, 188 socket_data_.reset(new SequencedSocketData(reads, arraysize(reads), writes,
189 arraysize(writes))); 189 arraysize(writes)));
190 190
191 Initialize(); 191 Initialize();
192 CompleteCryptoHandshake(); 192 CompleteCryptoHandshake();
193 const size_t kMaxOpenStreams = session_->get_max_open_streams(); 193 const size_t kMaxOpenStreams = session_->max_open_outgoing_streams();
194 194
195 std::vector<QuicChromiumClientStream*> streams; 195 std::vector<QuicChromiumClientStream*> streams;
196 for (size_t i = 0; i < kMaxOpenStreams; i++) { 196 for (size_t i = 0; i < kMaxOpenStreams; i++) {
197 QuicChromiumClientStream* stream = 197 QuicChromiumClientStream* stream =
198 session_->CreateOutgoingDynamicStream(kDefaultPriority); 198 session_->CreateOutgoingDynamicStream(kDefaultPriority);
199 EXPECT_TRUE(stream); 199 EXPECT_TRUE(stream);
200 streams.push_back(stream); 200 streams.push_back(stream);
201 } 201 }
202 202
203 QuicChromiumClientStream* stream; 203 QuicChromiumClientStream* stream;
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after
519 session_->connection()->SendPing(); 519 session_->connection()->SendPing();
520 EXPECT_FALSE(session_->connection()->connected()); 520 EXPECT_FALSE(session_->connection()->connected());
521 521
522 EXPECT_TRUE(socket_data.AllReadDataConsumed()); 522 EXPECT_TRUE(socket_data.AllReadDataConsumed());
523 EXPECT_TRUE(socket_data.AllWriteDataConsumed()); 523 EXPECT_TRUE(socket_data.AllWriteDataConsumed());
524 } 524 }
525 525
526 } // namespace 526 } // namespace
527 } // namespace test 527 } // namespace test
528 } // namespace net 528 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_chromium_client_session.cc ('k') | net/quic/quic_client_session_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698