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

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

Issue 2430973004: Landing Recent QUIC changes until 10:38 AM, Oct 17, 2016 UTC-4 (Closed)
Patch Set: Improving flagsaver logging Created 4 years, 2 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/tools/quic/quic_client_bin.cc ('k') | net/tools/quic/quic_dispatcher.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/tools/quic/quic_client_session.h" 5 #include "net/tools/quic/quic_client_session.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "base/strings/stringprintf.h" 10 #include "base/strings/stringprintf.h"
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 CompleteCryptoHandshake(kServerMaxIncomingStreams); 228 CompleteCryptoHandshake(kServerMaxIncomingStreams);
229 } 229 }
230 230
231 QuicSpdyClientStream* stream = 231 QuicSpdyClientStream* stream =
232 session_->CreateOutgoingDynamicStream(kDefaultPriority); 232 session_->CreateOutgoingDynamicStream(kDefaultPriority);
233 ASSERT_TRUE(stream); 233 ASSERT_TRUE(stream);
234 EXPECT_FALSE(session_->CreateOutgoingDynamicStream(kDefaultPriority)); 234 EXPECT_FALSE(session_->CreateOutgoingDynamicStream(kDefaultPriority));
235 235
236 // Close the stream and receive an RST frame to remove the unfinished stream 236 // Close the stream and receive an RST frame to remove the unfinished stream
237 session_->CloseStream(stream->id()); 237 session_->CloseStream(stream->id());
238 session_->OnRstStream(QuicRstStreamFrame( 238 session_->OnRstStream(
239 stream->id(), AdjustErrorForVersion(QUIC_RST_ACKNOWLEDGEMENT, GetParam()), 239 QuicRstStreamFrame(stream->id(), QUIC_RST_ACKNOWLEDGEMENT, 0));
240 0));
241 // Check that a new one can be created. 240 // Check that a new one can be created.
242 EXPECT_EQ(0u, session_->GetNumOpenOutgoingStreams()); 241 EXPECT_EQ(0u, session_->GetNumOpenOutgoingStreams());
243 stream = session_->CreateOutgoingDynamicStream(kDefaultPriority); 242 stream = session_->CreateOutgoingDynamicStream(kDefaultPriority);
244 EXPECT_TRUE(stream); 243 EXPECT_TRUE(stream);
245 } 244 }
246 245
247 TEST_P(QuicClientSessionTest, GoAwayReceived) { 246 TEST_P(QuicClientSessionTest, GoAwayReceived) {
248 CompleteCryptoHandshake(); 247 CompleteCryptoHandshake();
249 248
250 // After receiving a GoAway, I should no longer be able to create outgoing 249 // After receiving a GoAway, I should no longer be able to create outgoing
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
528 QuicClientPromisedInfo* promised = 527 QuicClientPromisedInfo* promised =
529 session_->GetPromisedById(promised_stream_id_); 528 session_->GetPromisedById(promised_stream_id_);
530 EXPECT_NE(promised, nullptr); 529 EXPECT_NE(promised, nullptr);
531 EXPECT_NE(session_->GetPromisedByUrl(promise_url_), nullptr); 530 EXPECT_NE(session_->GetPromisedByUrl(promise_url_), nullptr);
532 EXPECT_EQ(session_->GetPromisedStream(promised_stream_id_), nullptr); 531 EXPECT_EQ(session_->GetPromisedStream(promised_stream_id_), nullptr);
533 } 532 }
534 533
535 } // namespace 534 } // namespace
536 } // namespace test 535 } // namespace test
537 } // namespace net 536 } // namespace net
OLDNEW
« no previous file with comments | « net/tools/quic/quic_client_bin.cc ('k') | net/tools/quic/quic_dispatcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698