OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <stddef.h> | 5 #include <stddef.h> |
6 #include <sys/epoll.h> | 6 #include <sys/epoll.h> |
7 | 7 |
8 #include <cstdint> | 8 #include <cstdint> |
9 #include <list> | 9 #include <list> |
10 #include <memory> | 10 #include <memory> |
(...skipping 1141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1152 SpdyHeaderBlock headers; | 1152 SpdyHeaderBlock headers; |
1153 headers[":method"] = "POST"; | 1153 headers[":method"] = "POST"; |
1154 headers[":path"] = "/foo"; | 1154 headers[":path"] = "/foo"; |
1155 headers[":scheme"] = "https"; | 1155 headers[":scheme"] = "https"; |
1156 headers[":authority"] = server_hostname_; | 1156 headers[":authority"] = server_hostname_; |
1157 headers["key1"] = string(15 * 1024, 'a'); | 1157 headers["key1"] = string(15 * 1024, 'a'); |
1158 headers["key2"] = string(15 * 1024, 'a'); | 1158 headers["key2"] = string(15 * 1024, 'a'); |
1159 headers["key3"] = string(15 * 1024, 'a'); | 1159 headers["key3"] = string(15 * 1024, 'a'); |
1160 | 1160 |
1161 client_->SendCustomSynchronousRequest(headers, body); | 1161 client_->SendCustomSynchronousRequest(headers, body); |
1162 if (FLAGS_quic_reloadable_flag_quic_limit_uncompressed_headers) { | 1162 EXPECT_EQ(QUIC_HEADERS_TOO_LARGE, client_->stream_error()); |
1163 EXPECT_EQ(QUIC_HEADERS_TOO_LARGE, client_->stream_error()); | |
1164 } else { | |
1165 EXPECT_EQ(QUIC_STREAM_NO_ERROR, client_->stream_error()); | |
1166 EXPECT_EQ(kFooResponseBody, client_->response_body()); | |
1167 EXPECT_EQ("200", client_->response_headers()->find(":status")->second); | |
1168 } | |
1169 EXPECT_EQ(QUIC_NO_ERROR, client_->connection_error()); | 1163 EXPECT_EQ(QUIC_NO_ERROR, client_->connection_error()); |
1170 } | 1164 } |
1171 | 1165 |
1172 TEST_P(EndToEndTest, EarlyResponseWithQuicStreamNoError) { | 1166 TEST_P(EndToEndTest, EarlyResponseWithQuicStreamNoError) { |
1173 ASSERT_TRUE(Initialize()); | 1167 ASSERT_TRUE(Initialize()); |
1174 EXPECT_TRUE(client_->client()->WaitForCryptoHandshakeConfirmed()); | 1168 EXPECT_TRUE(client_->client()->WaitForCryptoHandshakeConfirmed()); |
1175 | 1169 |
1176 string large_body(1024 * 1024, 'a'); | 1170 string large_body(1024 * 1024, 'a'); |
1177 SpdyHeaderBlock headers; | 1171 SpdyHeaderBlock headers; |
1178 headers[":method"] = "POST"; | 1172 headers[":method"] = "POST"; |
(...skipping 1881 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3060 client_->WaitForResponse(); | 3054 client_->WaitForResponse(); |
3061 EXPECT_EQ(kBarResponseBody, client_->response_body()); | 3055 EXPECT_EQ(kBarResponseBody, client_->response_body()); |
3062 QuicConnectionStats client_stats = | 3056 QuicConnectionStats client_stats = |
3063 client_->client()->session()->connection()->GetStats(); | 3057 client_->client()->session()->connection()->GetStats(); |
3064 EXPECT_EQ(0u, client_stats.packets_lost); | 3058 EXPECT_EQ(0u, client_stats.packets_lost); |
3065 EXPECT_EQ(1, client_->client()->GetNumSentClientHellos()); | 3059 EXPECT_EQ(1, client_->client()->GetNumSentClientHellos()); |
3066 } | 3060 } |
3067 } // namespace | 3061 } // namespace |
3068 } // namespace test | 3062 } // namespace test |
3069 } // namespace net | 3063 } // namespace net |
OLD | NEW |