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

Side by Side Diff: net/http/http_proxy_client_socket_pool_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/http/http_network_transaction_unittest.cc ('k') | net/net.gypi » ('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/http/http_proxy_client_socket_pool.h" 5 #include "net/http/http_proxy_client_socket_pool.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 NULL /* transport_security_state */, 79 NULL /* transport_security_state */,
80 NULL /* cert_transparency_verifier */, 80 NULL /* cert_transparency_verifier */,
81 NULL /* ct_policy_enforcer */, 81 NULL /* ct_policy_enforcer */,
82 std::string() /* ssl_session_cache_shard */, 82 std::string() /* ssl_session_cache_shard */,
83 session_deps_.socket_factory.get(), 83 session_deps_.socket_factory.get(),
84 &transport_socket_pool_, 84 &transport_socket_pool_,
85 NULL, 85 NULL,
86 NULL, 86 NULL,
87 session_deps_.ssl_config_service.get(), 87 session_deps_.ssl_config_service.get(),
88 BoundNetLog().net_log()), 88 BoundNetLog().net_log()),
89 session_(CreateNetworkSession()),
90 spdy_util_(GetParam().protocol, GetParam().priority_to_dependency), 89 spdy_util_(GetParam().protocol, GetParam().priority_to_dependency),
91 pool_(kMaxSockets, 90 pool_(kMaxSockets,
92 kMaxSocketsPerGroup, 91 kMaxSocketsPerGroup,
93 &transport_socket_pool_, 92 &transport_socket_pool_,
94 &ssl_socket_pool_, 93 &ssl_socket_pool_,
95 NULL) { 94 NULL) {
96 SpdySession::SetPriorityDependencyDefaultForTesting( 95 session_deps_.enable_priority_dependencies =
97 GetParam().priority_to_dependency); 96 GetParam().priority_to_dependency;
97 session_ = CreateNetworkSession();
98 } 98 }
99 99
100 virtual ~HttpProxyClientSocketPoolTest() { 100 virtual ~HttpProxyClientSocketPoolTest() {}
101 SpdySession::SetPriorityDependencyDefaultForTesting(false);
102 }
103 101
104 void AddAuthToCache() { 102 void AddAuthToCache() {
105 const base::string16 kFoo(base::ASCIIToUTF16("foo")); 103 const base::string16 kFoo(base::ASCIIToUTF16("foo"));
106 const base::string16 kBar(base::ASCIIToUTF16("bar")); 104 const base::string16 kBar(base::ASCIIToUTF16("bar"));
107 GURL proxy_url(GetParam().proxy_type == HTTP ? 105 GURL proxy_url(GetParam().proxy_type == HTTP ?
108 (std::string("http://") + kHttpProxyHost) : 106 (std::string("http://") + kHttpProxyHost) :
109 (std::string("https://") + kHttpsProxyHost)); 107 (std::string("https://") + kHttpsProxyHost));
110 session_->http_auth_cache()->Add(proxy_url, 108 session_->http_auth_cache()->Add(proxy_url,
111 "MyRealm1", 109 "MyRealm1",
112 HttpAuth::AUTH_SCHEME_BASIC, 110 HttpAuth::AUTH_SCHEME_BASIC,
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 } 210 }
213 211
214 private: 212 private:
215 SpdySessionDependencies session_deps_; 213 SpdySessionDependencies session_deps_;
216 214
217 MockTransportClientSocketPool transport_socket_pool_; 215 MockTransportClientSocketPool transport_socket_pool_;
218 MockHostResolver host_resolver_; 216 MockHostResolver host_resolver_;
219 scoped_ptr<CertVerifier> cert_verifier_; 217 scoped_ptr<CertVerifier> cert_verifier_;
220 SSLClientSocketPool ssl_socket_pool_; 218 SSLClientSocketPool ssl_socket_pool_;
221 219
222 const scoped_ptr<HttpNetworkSession> session_; 220 scoped_ptr<HttpNetworkSession> session_;
223 221
224 protected: 222 protected:
225 SpdyTestUtil spdy_util_; 223 SpdyTestUtil spdy_util_;
226 scoped_ptr<SSLSocketDataProvider> ssl_data_; 224 scoped_ptr<SSLSocketDataProvider> ssl_data_;
227 scoped_ptr<SequencedSocketData> data_; 225 scoped_ptr<SequencedSocketData> data_;
228 HttpProxyClientSocketPool pool_; 226 HttpProxyClientSocketPool pool_;
229 ClientSocketHandle handle_; 227 ClientSocketHandle handle_;
230 TestCompletionCallback callback_; 228 TestCompletionCallback callback_;
231 }; 229 };
232 230
(...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after
741 // Make sure Location header was included and correct. 739 // Make sure Location header was included and correct.
742 std::string location; 740 std::string location;
743 EXPECT_TRUE(headers->IsRedirect(&location)); 741 EXPECT_TRUE(headers->IsRedirect(&location));
744 EXPECT_EQ(location, redirectTarget); 742 EXPECT_EQ(location, redirectTarget);
745 } 743 }
746 } 744 }
747 745
748 // It would be nice to also test the timeouts in HttpProxyClientSocketPool. 746 // It would be nice to also test the timeouts in HttpProxyClientSocketPool.
749 747
750 } // namespace net 748 } // namespace net
OLDNEW
« no previous file with comments | « net/http/http_network_transaction_unittest.cc ('k') | net/net.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698