| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "net/http/http_network_transaction.h" | 5 #include "net/http/http_network_transaction.h" |
| 6 | 6 |
| 7 #include <math.h> // ceil | 7 #include <math.h> // ceil |
| 8 #include <stdarg.h> | 8 #include <stdarg.h> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 379 | 379 |
| 380 // Original socket limits. Some tests set these. Safest to always restore | 380 // Original socket limits. Some tests set these. Safest to always restore |
| 381 // them once each test has been run. | 381 // them once each test has been run. |
| 382 int old_max_group_sockets_; | 382 int old_max_group_sockets_; |
| 383 int old_max_pool_sockets_; | 383 int old_max_pool_sockets_; |
| 384 }; | 384 }; |
| 385 | 385 |
| 386 INSTANTIATE_TEST_CASE_P( | 386 INSTANTIATE_TEST_CASE_P( |
| 387 NextProto, | 387 NextProto, |
| 388 HttpNetworkTransactionTest, | 388 HttpNetworkTransactionTest, |
| 389 testing::Values(kProtoSPDY2, kProtoSPDY3, kProtoSPDY31, kProtoSPDY4a2, | 389 testing::Values(kProtoDeprecatedSPDY2, |
| 390 kProtoSPDY3, kProtoSPDY31, kProtoSPDY4a2, |
| 390 kProtoHTTP2Draft04)); | 391 kProtoHTTP2Draft04)); |
| 391 | 392 |
| 392 namespace { | 393 namespace { |
| 393 | 394 |
| 394 // Fill |str| with a long header list that consumes >= |size| bytes. | 395 // Fill |str| with a long header list that consumes >= |size| bytes. |
| 395 void FillLargeHeadersString(std::string* str, int size) { | 396 void FillLargeHeadersString(std::string* str, int size) { |
| 396 const char* row = | 397 const char* row = |
| 397 "SomeHeaderName: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\r\n"; | 398 "SomeHeaderName: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\r\n"; |
| 398 const int sizeof_row = strlen(row); | 399 const int sizeof_row = strlen(row); |
| 399 const int num_rows = static_cast<int>( | 400 const int num_rows = static_cast<int>( |
| (...skipping 11822 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12222 // established, to let the HTTP request start. | 12223 // established, to let the HTTP request start. |
| 12223 ASSERT_EQ(OK, http_callback.WaitForResult()); | 12224 ASSERT_EQ(OK, http_callback.WaitForResult()); |
| 12224 std::string response_data; | 12225 std::string response_data; |
| 12225 ASSERT_EQ(OK, ReadTransaction(http_trans.get(), &response_data)); | 12226 ASSERT_EQ(OK, ReadTransaction(http_trans.get(), &response_data)); |
| 12226 EXPECT_EQ("falafel", response_data); | 12227 EXPECT_EQ("falafel", response_data); |
| 12227 | 12228 |
| 12228 EXPECT_EQ(1, GetIdleSocketCountInTransportSocketPool(session)); | 12229 EXPECT_EQ(1, GetIdleSocketCountInTransportSocketPool(session)); |
| 12229 } | 12230 } |
| 12230 | 12231 |
| 12231 } // namespace net | 12232 } // namespace net |
| OLD | NEW |