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

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

Issue 76723002: Land Recent QUIC Changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix compilation error Created 7 years, 1 month 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
« no previous file with comments | « net/quic/quic_session.cc ('k') | net/quic/reliable_quic_stream.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_session.h" 5 #include "net/quic/quic_session.h"
6 6
7 #include <set> 7 #include <set>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/containers/hash_tables.h" 10 #include "base/containers/hash_tables.h"
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after
450 EXPECT_CALL(*connection, SendRstStream(3, QUIC_STREAM_CANCELLED)); 450 EXPECT_CALL(*connection, SendRstStream(3, QUIC_STREAM_CANCELLED));
451 session.SendRstStream(3, QUIC_STREAM_CANCELLED); 451 session.SendRstStream(3, QUIC_STREAM_CANCELLED);
452 452
453 EXPECT_EQ(1u, session.GetNumOpenStreams()); 453 EXPECT_EQ(1u, session.GetNumOpenStreams());
454 454
455 connection->CloseConnection(QUIC_CONNECTION_TIMED_OUT, false); 455 connection->CloseConnection(QUIC_CONNECTION_TIMED_OUT, false);
456 456
457 EXPECT_EQ(0u, session.GetNumOpenStreams()); 457 EXPECT_EQ(0u, session.GetNumOpenStreams());
458 } 458 }
459 459
460 TEST_F(QuicSessionTest, RstStreamBeforeHeadersDecompressed) {
461 // Send two bytes of payload.
462 QuicStreamFrame data1(3, false, 0, MakeIOVector("HT"));
463 vector<QuicStreamFrame> frames;
464 frames.push_back(data1);
465 EXPECT_TRUE(session_.OnStreamFrames(frames));
466 EXPECT_EQ(1u, session_.GetNumOpenStreams());
467
468 // Send a reset before the headers have been decompressed. This causes
469 // an unrecoverable compression context state.
470 EXPECT_CALL(*connection_, SendConnectionClose(
471 QUIC_STREAM_RST_BEFORE_HEADERS_DECOMPRESSED));
472
473 QuicRstStreamFrame rst1(3, QUIC_STREAM_NO_ERROR);
474 session_.OnRstStream(rst1);
475 EXPECT_EQ(0u, session_.GetNumOpenStreams());
476 }
477
460 } // namespace 478 } // namespace
461 } // namespace test 479 } // namespace test
462 } // namespace net 480 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_session.cc ('k') | net/quic/reliable_quic_stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698