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

Unified Diff: net/quic/quic_session_test.cc

Issue 1457233003: Deprecate FLAGS_quic_count_unfinished_as_open_streams. (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/quic/quic_session.cc ('k') | net/tools/quic/quic_client_session_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_session_test.cc
diff --git a/net/quic/quic_session_test.cc b/net/quic/quic_session_test.cc
index 6d29f239f224f5abc1a39036063c18aee17972a0..e4b67b0331d0b4a572551b12974bd02414cb5468 100644
--- a/net/quic/quic_session_test.cc
+++ b/net/quic/quic_session_test.cc
@@ -969,36 +969,8 @@ TEST_P(QuicSessionTestServer, WindowUpdateUnblocksHeadersStream) {
EXPECT_FALSE(session_.IsStreamFlowControlBlocked());
}
-TEST_P(QuicSessionTestServer, TooManyUnfinishedStreamsCauseConnectionClose) {
- FLAGS_quic_count_unfinished_as_open_streams = false;
- // If a buggy/malicious peer creates too many streams that are not ended
- // with a FIN or RST then we send a connection close.
- EXPECT_CALL(*connection_,
- SendConnectionClose(QUIC_TOO_MANY_UNFINISHED_STREAMS));
-
- const QuicStreamId kMaxStreams = 5;
- QuicSessionPeer::SetMaxOpenStreams(&session_, kMaxStreams);
-
- // Create kMaxStreams + 1 data streams, and close them all without receiving
- // a FIN or a RST_STREAM from the client.
- const QuicStreamId kFirstStreamId = kClientDataStreamId1;
- const QuicStreamId kFinalStreamId =
- kClientDataStreamId1 + 2 * kMaxStreams + 1;
- for (QuicStreamId i = kFirstStreamId; i < kFinalStreamId; i += 2) {
- QuicStreamFrame data1(i, false, 0, StringPiece("HT"));
- session_.OnStreamFrame(data1);
- EXPECT_EQ(1u, session_.GetNumOpenStreams());
- EXPECT_CALL(*connection_, SendRstStream(i, _, _));
- session_.CloseStream(i);
- }
-
- // Called after any new data is received by the session, and triggers the
- // call to close the connection.
- session_.PostProcessAfterData();
-}
-
-TEST_P(QuicSessionTestServer, TooManyUnfinishedStreamsCauseServerRejectStream) {
- FLAGS_quic_count_unfinished_as_open_streams = true;
+TEST_P(QuicSessionTestServer,
+ TooManyUnfinishedStreamsCauseServerRejectStream) {
// If a buggy/malicious peer creates too many streams that are not ended
// with a FIN or RST then we send a connection close or an RST to
// refuse streams.
@@ -1038,20 +1010,13 @@ TEST_P(QuicSessionTestServer, DrainingStreamsDoNotCountAsOpened) {
// Verify that a draining stream (which has received a FIN but not consumed
// it) does not count against the open quota (because it is closed from the
// protocol point of view).
- if (FLAGS_quic_count_unfinished_as_open_streams) {
- if (GetParam() <= QUIC_VERSION_27) {
- EXPECT_CALL(*connection_, SendConnectionClose(QUIC_TOO_MANY_OPEN_STREAMS))
- .Times(0);
- } else {
- EXPECT_CALL(*connection_, SendRstStream(_, QUIC_REFUSED_STREAM, _))
- .Times(0);
- }
+ if (GetParam() <= QUIC_VERSION_27) {
+ EXPECT_CALL(*connection_,
+ SendConnectionClose(QUIC_TOO_MANY_OPEN_STREAMS)).Times(0);
} else {
EXPECT_CALL(*connection_,
- SendConnectionClose(QUIC_TOO_MANY_UNFINISHED_STREAMS))
- .Times(0);
+ SendRstStream(_, QUIC_REFUSED_STREAM, _)).Times(0);
}
-
const QuicStreamId kMaxStreams = 5;
QuicSessionPeer::SetMaxOpenStreams(&session_, kMaxStreams);
« no previous file with comments | « net/quic/quic_session.cc ('k') | net/tools/quic/quic_client_session_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698