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

Unified Diff: net/quic/quic_session_test.cc

Issue 1541263002: Landing Recent QUIC changes until 12/18/2015 13:57 UTC (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: replace -1 with 0xff for InvalidPathId Created 5 years 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/quic/quic_spdy_stream.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 feae2fb1ba32c6869f96592dd4ed422c8ea8adaf..f7274496b05a11869850227d08a8f2ec925619f4 100644
--- a/net/quic/quic_session_test.cc
+++ b/net/quic/quic_session_test.cc
@@ -136,7 +136,8 @@ class TestSession : public QuicSpdySession {
TestStream* CreateIncomingDynamicStream(QuicStreamId id) override {
// Enforce the limit on the number of open streams.
if (GetNumOpenIncomingStreams() + 1 > get_max_open_streams()) {
- connection()->SendConnectionClose(QUIC_TOO_MANY_OPEN_STREAMS);
+ connection()->SendConnectionCloseWithDetails(QUIC_TOO_MANY_OPEN_STREAMS,
+ "Too many streams!");
return nullptr;
} else {
return new TestStream(id, this);
@@ -336,7 +337,7 @@ TEST_P(QuicSessionTestServer, IsClosedStreamPeerCreated) {
TEST_P(QuicSessionTestServer, MaximumAvailableOpenedStreams) {
QuicStreamId stream_id = kClientDataStreamId1;
session_.GetOrCreateDynamicStream(stream_id);
- EXPECT_CALL(*connection_, SendConnectionClose(_)).Times(0);
+ EXPECT_CALL(*connection_, SendConnectionCloseWithDetails(_, _)).Times(0);
EXPECT_NE(nullptr,
session_.GetOrCreateDynamicStream(
stream_id + 2 * (session_.get_max_open_streams() - 1)));
@@ -348,8 +349,8 @@ TEST_P(QuicSessionTestServer, TooManyAvailableStreams) {
EXPECT_NE(nullptr, session_.GetOrCreateDynamicStream(stream_id1));
// A stream ID which is too large to create.
stream_id2 = stream_id1 + 2 * session_.get_max_available_streams() + 4;
- EXPECT_CALL(*connection_,
- SendConnectionClose(QUIC_TOO_MANY_AVAILABLE_STREAMS));
+ EXPECT_CALL(*connection_, SendConnectionCloseWithDetails(
+ QUIC_TOO_MANY_AVAILABLE_STREAMS, _));
EXPECT_EQ(nullptr, session_.GetOrCreateDynamicStream(stream_id2));
}
@@ -360,7 +361,7 @@ TEST_P(QuicSessionTestServer, ManyAvailableStreams) {
QuicStreamId stream_id = kClientDataStreamId1;
// Create one stream.
session_.GetOrCreateDynamicStream(stream_id);
- EXPECT_CALL(*connection_, SendConnectionClose(_)).Times(0);
+ EXPECT_CALL(*connection_, SendConnectionCloseWithDetails(_, _)).Times(0);
// Create the largest stream ID of a threatened total of 200 streams.
session_.GetOrCreateDynamicStream(stream_id + 2 * (200 - 1));
}
@@ -731,8 +732,8 @@ TEST_P(QuicSessionTestServer, MultipleRstStreamsCauseSingleConnectionClose) {
// Process first invalid stream reset, resulting in the connection being
// closed.
- EXPECT_CALL(*connection_,
- SendConnectionClose(QUIC_TOO_MANY_AVAILABLE_STREAMS));
+ EXPECT_CALL(*connection_, SendConnectionCloseWithDetails(
+ QUIC_TOO_MANY_AVAILABLE_STREAMS, _));
const QuicStreamId kLargeInvalidStreamId = 99999999;
QuicRstStreamFrame rst1(kLargeInvalidStreamId, QUIC_STREAM_NO_ERROR, 0);
@@ -1011,8 +1012,8 @@ TEST_P(QuicSessionTestServer, InvalidStreamFlowControlWindowInHandshake) {
QuicConfigPeer::SetReceivedInitialStreamFlowControlWindow(session_.config(),
kInvalidWindow);
- EXPECT_CALL(*connection_,
- SendConnectionClose(QUIC_FLOW_CONTROL_INVALID_WINDOW));
+ EXPECT_CALL(*connection_, SendConnectionCloseWithDetails(
+ QUIC_FLOW_CONTROL_INVALID_WINDOW, _));
session_.OnConfigNegotiated();
}
@@ -1023,8 +1024,8 @@ TEST_P(QuicSessionTestServer, InvalidSessionFlowControlWindowInHandshake) {
QuicConfigPeer::SetReceivedInitialSessionFlowControlWindow(session_.config(),
kInvalidWindow);
- EXPECT_CALL(*connection_,
- SendConnectionClose(QUIC_FLOW_CONTROL_INVALID_WINDOW));
+ EXPECT_CALL(*connection_, SendConnectionCloseWithDetails(
+ QUIC_FLOW_CONTROL_INVALID_WINDOW, _));
session_.OnConfigNegotiated();
}
@@ -1032,8 +1033,8 @@ TEST_P(QuicSessionTestServer, FlowControlWithInvalidFinalOffset) {
// Test that if we receive a stream RST with a highest byte offset that
// violates flow control, that we close the connection.
const uint64_t kLargeOffset = kInitialSessionFlowControlWindowForTest + 1;
- EXPECT_CALL(*connection_,
- SendConnectionClose(QUIC_FLOW_CONTROL_RECEIVED_TOO_MUCH_DATA))
+ EXPECT_CALL(*connection_, SendConnectionCloseWithDetails(
+ QUIC_FLOW_CONTROL_RECEIVED_TOO_MUCH_DATA, _))
.Times(2);
// Check that stream frame + FIN results in connection close.
@@ -1091,7 +1092,8 @@ TEST_P(QuicSessionTestServer, TooManyUnfinishedStreamsCauseServerRejectStream) {
}
if (GetParam() <= QUIC_VERSION_27) {
- EXPECT_CALL(*connection_, SendConnectionClose(QUIC_TOO_MANY_OPEN_STREAMS));
+ EXPECT_CALL(*connection_,
+ SendConnectionCloseWithDetails(QUIC_TOO_MANY_OPEN_STREAMS, _));
EXPECT_CALL(*connection_, SendRstStream(kFinalStreamId, _, _)).Times(0);
} else {
EXPECT_CALL(*connection_,
@@ -1112,7 +1114,8 @@ TEST_P(QuicSessionTestServer, DrainingStreamsDoNotCountAsOpened) {
// it) does not count against the open quota (because it is closed from the
// protocol point of view).
if (GetParam() <= QUIC_VERSION_27) {
- EXPECT_CALL(*connection_, SendConnectionClose(QUIC_TOO_MANY_OPEN_STREAMS))
+ EXPECT_CALL(*connection_,
+ SendConnectionCloseWithDetails(QUIC_TOO_MANY_OPEN_STREAMS, _))
.Times(0);
} else {
EXPECT_CALL(*connection_, SendRstStream(_, QUIC_REFUSED_STREAM, _))
« no previous file with comments | « net/quic/quic_session.cc ('k') | net/quic/quic_spdy_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698