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

Unified Diff: net/quic/quic_connection_test.cc

Issue 1505563002: Close the QUIC connection when non-crypto stream data is written at ENCRYPTION_NONE. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase 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_connection.cc ('k') | net/quic/quic_flags.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_connection_test.cc
diff --git a/net/quic/quic_connection_test.cc b/net/quic/quic_connection_test.cc
index d9ccefda590cdbea2ce8d5875478d1a93d83f436..37b7a20979ce1b67269b868856f6ce78451a8eff 100644
--- a/net/quic/quic_connection_test.cc
+++ b/net/quic/quic_connection_test.cc
@@ -739,6 +739,9 @@ class QuicConnectionTest : public ::testing::TestWithParam<TestParams> {
EXPECT_CALL(*loss_algorithm_, DetectLostPackets(_, _, _, _))
.WillRepeatedly(Return(PacketNumberSet()));
}
+ // TODO(ianswett): Fix QuicConnectionTests so they don't attempt to write
+ // non-crypto stream data at ENCRYPTION_NONE.
+ FLAGS_quic_never_write_unencrypted_data = false;
}
QuicVersion version() { return GetParam().version; }
@@ -5505,6 +5508,15 @@ TEST_P(QuicConnectionTest, ReevaluateTimeUntilSendOnAck) {
writer_->Reset();
}
+TEST_P(QuicConnectionTest, SendingUnencryptedStreamDataFails) {
+ FLAGS_quic_never_write_unencrypted_data = true;
+ EXPECT_CALL(visitor_,
+ OnConnectionClosed(QUIC_UNENCRYPTED_STREAM_DATA, false));
+ EXPECT_DFATAL(connection_.SendStreamDataWithString(3, "", 0, kFin, nullptr),
+ "Cannot send stream data without encryption.");
+ EXPECT_FALSE(connection_.connected());
+}
+
} // namespace
} // namespace test
} // namespace net
« no previous file with comments | « net/quic/quic_connection.cc ('k') | net/quic/quic_flags.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698