| 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 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 1150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1161 } | 1161 } |
| 1162 | 1162 |
| 1163 TEST_P(EndToEndTest, NegotiateMaxOpenStreams) { | 1163 TEST_P(EndToEndTest, NegotiateMaxOpenStreams) { |
| 1164 // Negotiate 1 max open stream. | 1164 // Negotiate 1 max open stream. |
| 1165 client_config_.SetMaxStreamsPerConnection(1, 1); | 1165 client_config_.SetMaxStreamsPerConnection(1, 1); |
| 1166 ASSERT_TRUE(Initialize()); | 1166 ASSERT_TRUE(Initialize()); |
| 1167 client_->client()->WaitForCryptoHandshakeConfirmed(); | 1167 client_->client()->WaitForCryptoHandshakeConfirmed(); |
| 1168 | 1168 |
| 1169 // Make the client misbehave after negotiation. | 1169 // Make the client misbehave after negotiation. |
| 1170 const int kServerMaxStreams = kMaxStreamsMinimumIncrement + 1; | 1170 const int kServerMaxStreams = kMaxStreamsMinimumIncrement + 1; |
| 1171 QuicSessionPeer::SetMaxOpenStreams(client_->client()->session(), | 1171 QuicSessionPeer::SetMaxOpenOutgoingStreams(client_->client()->session(), |
| 1172 kServerMaxStreams + 1); | 1172 kServerMaxStreams + 1); |
| 1173 | 1173 |
| 1174 HTTPMessage request(HttpConstants::HTTP_1_1, HttpConstants::POST, "/foo"); | 1174 HTTPMessage request(HttpConstants::HTTP_1_1, HttpConstants::POST, "/foo"); |
| 1175 request.AddHeader("content-length", "3"); | 1175 request.AddHeader("content-length", "3"); |
| 1176 request.set_has_complete_message(false); | 1176 request.set_has_complete_message(false); |
| 1177 | 1177 |
| 1178 // The server supports a small number of additional streams beyond the | 1178 // The server supports a small number of additional streams beyond the |
| 1179 // negotiated limit. Open enough streams to go beyond that limit. | 1179 // negotiated limit. Open enough streams to go beyond that limit. |
| 1180 for (int i = 0; i < kServerMaxStreams + 1; ++i) { | 1180 for (int i = 0; i < kServerMaxStreams + 1; ++i) { |
| 1181 client_->SendMessage(request); | 1181 client_->SendMessage(request); |
| 1182 } | 1182 } |
| (...skipping 987 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2170 "www.google.com", "/trailer_url", headers, kBody, trailers); | 2170 "www.google.com", "/trailer_url", headers, kBody, trailers); |
| 2171 | 2171 |
| 2172 EXPECT_EQ(kBody, client_->SendSynchronousRequest("/trailer_url")); | 2172 EXPECT_EQ(kBody, client_->SendSynchronousRequest("/trailer_url")); |
| 2173 EXPECT_EQ(200u, client_->response_headers()->parsed_response_code()); | 2173 EXPECT_EQ(200u, client_->response_headers()->parsed_response_code()); |
| 2174 EXPECT_EQ(trailers, client_->response_trailers()); | 2174 EXPECT_EQ(trailers, client_->response_trailers()); |
| 2175 } | 2175 } |
| 2176 | 2176 |
| 2177 } // namespace | 2177 } // namespace |
| 2178 } // namespace test | 2178 } // namespace test |
| 2179 } // namespace net | 2179 } // namespace net |
| OLD | NEW |