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

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

Issue 2430973004: Landing Recent QUIC changes until 10:38 AM, Oct 17, 2016 UTC-4 (Closed)
Patch Set: Improving flagsaver logging Created 4 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/quic/test_tools/simulator/traffic_policer.cc ('k') | net/tools/quic/quic_client_bin.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/tools/quic/end_to_end_test.cc
diff --git a/net/tools/quic/end_to_end_test.cc b/net/tools/quic/end_to_end_test.cc
index 2196187573080fff686a2ed694cff77b460d4110..325c998d61ace64049cd135bc286eed20de03660 100644
--- a/net/tools/quic/end_to_end_test.cc
+++ b/net/tools/quic/end_to_end_test.cc
@@ -1181,6 +1181,32 @@ TEST_P(EndToEndTest, InvalidStream) {
EXPECT_EQ(QUIC_INVALID_STREAM_ID, client_->connection_error());
}
+// Test that if the the server will close the connection if the client attempts
+// to send a request with overly large headers.
+TEST_P(EndToEndTest, LargeHeaders) {
+ ASSERT_TRUE(Initialize());
+ client_->client()->WaitForCryptoHandshakeConfirmed();
+
+ string body;
+ test::GenerateBody(&body, kMaxPacketSize);
+
+ HTTPMessage request(HttpConstants::HTTP_1_1, HttpConstants::POST, "/foo");
+ request.AddHeader("key1", string(15 * 1024, 'a'));
+ request.AddHeader("key2", string(15 * 1024, 'a'));
+ request.AddHeader("key3", string(15 * 1024, 'a'));
+ request.AddBody(body, true);
+
+ client_->SendCustomSynchronousRequest(request);
+ if (FLAGS_quic_limit_uncompressed_headers) {
+ EXPECT_EQ(QUIC_HEADERS_TOO_LARGE, client_->stream_error());
+ } else {
+ EXPECT_EQ(QUIC_STREAM_NO_ERROR, client_->stream_error());
+ EXPECT_EQ(kFooResponseBody, client_->response_body());
+ EXPECT_EQ(200u, client_->response_headers()->parsed_response_code());
+ }
+ EXPECT_EQ(QUIC_NO_ERROR, client_->connection_error());
+}
+
TEST_P(EndToEndTest, EarlyResponseWithQuicStreamNoError) {
ASSERT_TRUE(Initialize());
client_->client()->WaitForCryptoHandshakeConfirmed();
« no previous file with comments | « net/quic/test_tools/simulator/traffic_policer.cc ('k') | net/tools/quic/quic_client_bin.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698