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

Unified Diff: net/tools/quic/quic_client_session_test.cc

Issue 667763003: Landing Recent QUIC Changes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months 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/tools/quic/end_to_end_test.cc ('k') | net/tools/quic/quic_server_session.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/tools/quic/quic_client_session_test.cc
diff --git a/net/tools/quic/quic_client_session_test.cc b/net/tools/quic/quic_client_session_test.cc
index 8a78878a0f0f265d96f048dceacbfd32138af1bc..61f8c011f67d17ba37c2484ef50d2c3a65462bd0 100644
--- a/net/tools/quic/quic_client_session_test.cc
+++ b/net/tools/quic/quic_client_session_test.cc
@@ -111,10 +111,8 @@ TEST_P(ToolsQuicClientSessionTest, SetFecProtectionFromConfig) {
EXPECT_EQ(FEC_PROTECT_OPTIONAL, stream->fec_policy());
}
-TEST_P(ToolsQuicClientSessionTest, EmptyPacketReceived) {
- // This test covers broken behavior that empty packets cause QUIC connection
- // broken.
-
+// Regression test for b/17206611.
+TEST_P(ToolsQuicClientSessionTest, InvalidPacketReceived) {
// Create Packet with 0 length.
QuicEncryptedPacket invalid_packet(nullptr, 0, false);
IPEndPoint server_address(TestPeerIPAddress(), kTestPort);
@@ -126,16 +124,12 @@ TEST_P(ToolsQuicClientSessionTest, EmptyPacketReceived) {
Invoke(reinterpret_cast<MockConnection*>(session_->connection()),
&MockConnection::ReallyProcessUdpPacket));
- // Expect call to close connection with error QUIC_INVALID_PACKET_HEADER.
- // TODO(b/17206611): Correct behavior: packet should get dropped and
- // connection should remain open.
- EXPECT_CALL(*connection_, SendConnectionCloseWithDetails(
- QUIC_INVALID_PACKET_HEADER, _)).Times(1);
+ // Validate that empty packets don't close the connection.
+ EXPECT_CALL(*connection_, SendConnectionCloseWithDetails(_, _)).Times(0);
session_->connection()->ProcessUdpPacket(client_address, server_address,
invalid_packet);
- // Create a packet that causes DecryptPacket failed. The packet will get
- // dropped without closing connection. This is a correct behavior.
+ // Verifiy that small, invalid packets don't close the connection.
char buf[2] = {0x00, 0x01};
QuicEncryptedPacket valid_packet(buf, 2, false);
// Close connection shouldn't be called.
« no previous file with comments | « net/tools/quic/end_to_end_test.cc ('k') | net/tools/quic/quic_server_session.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698