| 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 "net/spdy/spdy_session.h" | 5 #include "net/spdy/spdy_session.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/base64.h" | 9 #include "base/base64.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 old_max_pool_sockets_(ClientSocketPoolManager::max_sockets_per_pool( | 132 old_max_pool_sockets_(ClientSocketPoolManager::max_sockets_per_pool( |
| 133 HttpNetworkSession::NORMAL_SOCKET_POOL)), | 133 HttpNetworkSession::NORMAL_SOCKET_POOL)), |
| 134 spdy_util_(GetProtocol(), GetDependenciesFromPriority()), | 134 spdy_util_(GetProtocol(), GetDependenciesFromPriority()), |
| 135 session_deps_(GetProtocol()), | 135 session_deps_(GetProtocol()), |
| 136 spdy_session_pool_(nullptr), | 136 spdy_session_pool_(nullptr), |
| 137 test_url_(kDefaultURL), | 137 test_url_(kDefaultURL), |
| 138 test_host_port_pair_(HostPortPair::FromURL(test_url_)), | 138 test_host_port_pair_(HostPortPair::FromURL(test_url_)), |
| 139 key_(test_host_port_pair_, | 139 key_(test_host_port_pair_, |
| 140 ProxyServer::Direct(), | 140 ProxyServer::Direct(), |
| 141 PRIVACY_MODE_DISABLED) { | 141 PRIVACY_MODE_DISABLED) { |
| 142 SpdySession::SetPriorityDependencyDefaultForTesting( | 142 session_deps_.enable_priority_dependencies = GetDependenciesFromPriority(); |
| 143 GetDependenciesFromPriority()); | |
| 144 } | 143 } |
| 145 | 144 |
| 146 virtual ~SpdySessionTest() { | 145 virtual ~SpdySessionTest() { |
| 147 // Important to restore the per-pool limit first, since the pool limit must | 146 // Important to restore the per-pool limit first, since the pool limit must |
| 148 // always be greater than group limit, and the tests reduce both limits. | 147 // always be greater than group limit, and the tests reduce both limits. |
| 149 ClientSocketPoolManager::set_max_sockets_per_pool( | 148 ClientSocketPoolManager::set_max_sockets_per_pool( |
| 150 HttpNetworkSession::NORMAL_SOCKET_POOL, old_max_pool_sockets_); | 149 HttpNetworkSession::NORMAL_SOCKET_POOL, old_max_pool_sockets_); |
| 151 ClientSocketPoolManager::set_max_sockets_per_group( | 150 ClientSocketPoolManager::set_max_sockets_per_group( |
| 152 HttpNetworkSession::NORMAL_SOCKET_POOL, old_max_group_sockets_); | 151 HttpNetworkSession::NORMAL_SOCKET_POOL, old_max_group_sockets_); |
| 153 SpdySession::SetPriorityDependencyDefaultForTesting(false); | |
| 154 } | 152 } |
| 155 | 153 |
| 156 void SetUp() override { | 154 void SetUp() override { |
| 157 g_time_delta = base::TimeDelta(); | 155 g_time_delta = base::TimeDelta(); |
| 158 g_time_now = base::TimeTicks::Now(); | 156 g_time_now = base::TimeTicks::Now(); |
| 159 session_deps_.net_log = log_.bound().net_log(); | 157 session_deps_.net_log = log_.bound().net_log(); |
| 160 } | 158 } |
| 161 | 159 |
| 162 void CreateNetworkSession() { | 160 void CreateNetworkSession() { |
| 163 DCHECK(!http_session_); | 161 DCHECK(!http_session_); |
| (...skipping 5279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5443 ssl_info.cert = ImportCertFromFile(GetTestCertsDirectory(), | 5441 ssl_info.cert = ImportCertFromFile(GetTestCertsDirectory(), |
| 5444 "spdy_pooling.pem"); | 5442 "spdy_pooling.pem"); |
| 5445 ssl_info.is_issued_by_known_root = true; | 5443 ssl_info.is_issued_by_known_root = true; |
| 5446 ssl_info.public_key_hashes.push_back(test::GetTestHashValue(primary_pin)); | 5444 ssl_info.public_key_hashes.push_back(test::GetTestHashValue(primary_pin)); |
| 5447 | 5445 |
| 5448 EXPECT_TRUE(SpdySession::CanPool( | 5446 EXPECT_TRUE(SpdySession::CanPool( |
| 5449 &tss, ssl_info, "www.example.org", "mail.example.org")); | 5447 &tss, ssl_info, "www.example.org", "mail.example.org")); |
| 5450 } | 5448 } |
| 5451 | 5449 |
| 5452 } // namespace net | 5450 } // namespace net |
| OLD | NEW |