Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(225)

Side by Side Diff: net/spdy/spdy_session_unittest.cc

Issue 1779733003: Fix bug in net::RequestPriority -> HTTP/2 dependency conversion. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Make bi-directional stream unittests enable priority->dependency setting. Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/spdy/spdy_session_pool_unittest.cc ('k') | net/spdy/spdy_stream_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « net/spdy/spdy_session_pool_unittest.cc ('k') | net/spdy/spdy_stream_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698