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

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

Issue 1413143004: Add new version QUIC_VERSION_29 in which streams honor RST_STREAM + NO_ERROR. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
« no previous file with comments | « net/quic/quic_protocol.cc ('k') | net/quic/quic_spdy_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 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/containers/hash_tables.h" 10 #include "base/containers/hash_tables.h"
(...skipping 594 matching lines...) Expand 10 before | Expand all | Expand 10 after
605 QuicConnectionPeer::GetNetworkTimeout(connection_).ToSeconds()); 605 QuicConnectionPeer::GetNetworkTimeout(connection_).ToSeconds());
606 } 606 }
607 607
608 TEST_P(QuicSessionTestServer, RstStreamBeforeHeadersDecompressed) { 608 TEST_P(QuicSessionTestServer, RstStreamBeforeHeadersDecompressed) {
609 // Send two bytes of payload. 609 // Send two bytes of payload.
610 QuicStreamFrame data1(kClientDataStreamId1, false, 0, StringPiece("HT")); 610 QuicStreamFrame data1(kClientDataStreamId1, false, 0, StringPiece("HT"));
611 session_.OnStreamFrame(data1); 611 session_.OnStreamFrame(data1);
612 EXPECT_EQ(1u, session_.GetNumOpenStreams()); 612 EXPECT_EQ(1u, session_.GetNumOpenStreams());
613 613
614 EXPECT_CALL(*connection_, SendRstStream(kClientDataStreamId1, _, _)); 614 EXPECT_CALL(*connection_, SendRstStream(kClientDataStreamId1, _, _));
615 QuicRstStreamFrame rst1(kClientDataStreamId1, QUIC_STREAM_NO_ERROR, 0); 615 QuicRstStreamFrame rst1(kClientDataStreamId1, QUIC_ERROR_PROCESSING_STREAM,
616 0);
616 session_.OnRstStream(rst1); 617 session_.OnRstStream(rst1);
617 EXPECT_EQ(0u, session_.GetNumOpenStreams()); 618 EXPECT_EQ(0u, session_.GetNumOpenStreams());
618 // Connection should remain alive. 619 // Connection should remain alive.
619 EXPECT_TRUE(connection_->connected()); 620 EXPECT_TRUE(connection_->connected());
620 } 621 }
621 622
622 TEST_P(QuicSessionTestServer, MultipleRstStreamsCauseSingleConnectionClose) { 623 TEST_P(QuicSessionTestServer, MultipleRstStreamsCauseSingleConnectionClose) {
623 // If multiple invalid reset stream frames arrive in a single packet, this 624 // If multiple invalid reset stream frames arrive in a single packet, this
624 // should trigger a connection close. However there is no need to send 625 // should trigger a connection close. However there is no need to send
625 // multiple connection close frames. 626 // multiple connection close frames.
(...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after
1122 // Verify that there is no entry for the stream in 1123 // Verify that there is no entry for the stream in
1123 // locally_closed_streams_highest_offset_. 1124 // locally_closed_streams_highest_offset_.
1124 EXPECT_EQ( 1125 EXPECT_EQ(
1125 FLAGS_quic_fix_fin_accounting ? 0u : 1u, 1126 FLAGS_quic_fix_fin_accounting ? 0u : 1u,
1126 QuicSessionPeer::GetLocallyClosedStreamsHighestOffset(&session_).size()); 1127 QuicSessionPeer::GetLocallyClosedStreamsHighestOffset(&session_).size());
1127 } 1128 }
1128 1129
1129 } // namespace 1130 } // namespace
1130 } // namespace test 1131 } // namespace test
1131 } // namespace net 1132 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_protocol.cc ('k') | net/quic/quic_spdy_stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698