| 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 <stdint.h> | 9 #include <stdint.h> |
| 10 #include <limits> | 10 #include <limits> |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 264 : public PlatformTest, | 264 : public PlatformTest, |
| 265 public ::testing::WithParamInterface<TestCase> { | 265 public ::testing::WithParamInterface<TestCase> { |
| 266 public: | 266 public: |
| 267 virtual ~HttpNetworkTransactionTest() { | 267 virtual ~HttpNetworkTransactionTest() { |
| 268 // Important to restore the per-pool limit first, since the pool limit must | 268 // Important to restore the per-pool limit first, since the pool limit must |
| 269 // always be greater than group limit, and the tests reduce both limits. | 269 // always be greater than group limit, and the tests reduce both limits. |
| 270 ClientSocketPoolManager::set_max_sockets_per_pool( | 270 ClientSocketPoolManager::set_max_sockets_per_pool( |
| 271 HttpNetworkSession::NORMAL_SOCKET_POOL, old_max_pool_sockets_); | 271 HttpNetworkSession::NORMAL_SOCKET_POOL, old_max_pool_sockets_); |
| 272 ClientSocketPoolManager::set_max_sockets_per_group( | 272 ClientSocketPoolManager::set_max_sockets_per_group( |
| 273 HttpNetworkSession::NORMAL_SOCKET_POOL, old_max_group_sockets_); | 273 HttpNetworkSession::NORMAL_SOCKET_POOL, old_max_group_sockets_); |
| 274 SpdySession::SetPriorityDependencyDefaultForTesting(false); | |
| 275 } | 274 } |
| 276 | 275 |
| 277 protected: | 276 protected: |
| 278 HttpNetworkTransactionTest() | 277 HttpNetworkTransactionTest() |
| 279 : spdy_util_(GetProtocol(), GetDependenciesFromPriority()), | 278 : spdy_util_(GetProtocol(), GetDependenciesFromPriority()), |
| 280 session_deps_(GetProtocol()), | 279 session_deps_(GetProtocol()), |
| 281 old_max_group_sockets_(ClientSocketPoolManager::max_sockets_per_group( | 280 old_max_group_sockets_(ClientSocketPoolManager::max_sockets_per_group( |
| 282 HttpNetworkSession::NORMAL_SOCKET_POOL)), | 281 HttpNetworkSession::NORMAL_SOCKET_POOL)), |
| 283 old_max_pool_sockets_(ClientSocketPoolManager::max_sockets_per_pool( | 282 old_max_pool_sockets_(ClientSocketPoolManager::max_sockets_per_pool( |
| 284 HttpNetworkSession::NORMAL_SOCKET_POOL)) { | 283 HttpNetworkSession::NORMAL_SOCKET_POOL)) { |
| 285 SpdySession::SetPriorityDependencyDefaultForTesting( | 284 session_deps_.enable_priority_dependencies = GetDependenciesFromPriority(); |
| 286 GetDependenciesFromPriority()); | |
| 287 } | 285 } |
| 288 | 286 |
| 289 struct SimpleGetHelperResult { | 287 struct SimpleGetHelperResult { |
| 290 int rv; | 288 int rv; |
| 291 std::string status_line; | 289 std::string status_line; |
| 292 std::string response_data; | 290 std::string response_data; |
| 293 int64_t total_received_bytes; | 291 int64_t total_received_bytes; |
| 294 int64_t total_sent_bytes; | 292 int64_t total_sent_bytes; |
| 295 LoadTimingInfo load_timing_info; | 293 LoadTimingInfo load_timing_info; |
| 296 ConnectionAttempts connection_attempts; | 294 ConnectionAttempts connection_attempts; |
| (...skipping 15655 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 15952 base::MessageLoop::current()->RunUntilIdle(); | 15950 base::MessageLoop::current()->RunUntilIdle(); |
| 15953 | 15951 |
| 15954 EXPECT_TRUE(trans.GetResponseInfo()->was_fetched_via_spdy); | 15952 EXPECT_TRUE(trans.GetResponseInfo()->was_fetched_via_spdy); |
| 15955 HttpRequestHeaders headers; | 15953 HttpRequestHeaders headers; |
| 15956 ASSERT_TRUE(trans.GetFullRequestHeaders(&headers)); | 15954 ASSERT_TRUE(trans.GetFullRequestHeaders(&headers)); |
| 15957 EXPECT_TRUE(headers.HasHeader(HttpRequestHeaders::kTokenBinding)); | 15955 EXPECT_TRUE(headers.HasHeader(HttpRequestHeaders::kTokenBinding)); |
| 15958 } | 15956 } |
| 15959 #endif // !defined(OS_IOS) | 15957 #endif // !defined(OS_IOS) |
| 15960 | 15958 |
| 15961 } // namespace net | 15959 } // namespace net |
| OLD | NEW |