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

Side by Side Diff: net/http/http_network_transaction_unittest.cc

Issue 3518001: HttpAuthHandlerFactory::CreateDefault requires a HostResolver argument. (Closed)
Patch Set: Created 10 years, 2 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_auth_unittest.cc ('k') | net/http/http_proxy_client_socket_pool_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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 <vector> 8 #include <vector>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 }; 105 };
106 106
107 // Helper to manage the lifetimes of the dependencies for a 107 // Helper to manage the lifetimes of the dependencies for a
108 // HttpNetworkTransaction. 108 // HttpNetworkTransaction.
109 struct SessionDependencies { 109 struct SessionDependencies {
110 // Default set of dependencies -- "null" proxy service. 110 // Default set of dependencies -- "null" proxy service.
111 SessionDependencies() 111 SessionDependencies()
112 : host_resolver(new MockHostResolver), 112 : host_resolver(new MockHostResolver),
113 proxy_service(ProxyService::CreateDirect()), 113 proxy_service(ProxyService::CreateDirect()),
114 ssl_config_service(new SSLConfigServiceDefaults), 114 ssl_config_service(new SSLConfigServiceDefaults),
115 http_auth_handler_factory(HttpAuthHandlerFactory::CreateDefault()), 115 http_auth_handler_factory(
116 HttpAuthHandlerFactory::CreateDefault(host_resolver)),
116 spdy_session_pool(new SpdySessionPool(NULL)), 117 spdy_session_pool(new SpdySessionPool(NULL)),
117 net_log(NULL) {} 118 net_log(NULL) {}
118 119
119 // Custom proxy service dependency. 120 // Custom proxy service dependency.
120 explicit SessionDependencies(ProxyService* proxy_service) 121 explicit SessionDependencies(ProxyService* proxy_service)
121 : host_resolver(new MockHostResolver), 122 : host_resolver(new MockHostResolver),
122 proxy_service(proxy_service), 123 proxy_service(proxy_service),
123 ssl_config_service(new SSLConfigServiceDefaults), 124 ssl_config_service(new SSLConfigServiceDefaults),
124 http_auth_handler_factory(HttpAuthHandlerFactory::CreateDefault()), 125 http_auth_handler_factory(
126 HttpAuthHandlerFactory::CreateDefault(host_resolver)),
125 spdy_session_pool(new SpdySessionPool(NULL)), 127 spdy_session_pool(new SpdySessionPool(NULL)),
126 net_log(NULL) {} 128 net_log(NULL) {}
127 129
128 scoped_refptr<MockHostResolverBase> host_resolver; 130 scoped_refptr<MockHostResolverBase> host_resolver;
129 scoped_refptr<ProxyService> proxy_service; 131 scoped_refptr<ProxyService> proxy_service;
130 scoped_refptr<SSLConfigService> ssl_config_service; 132 scoped_refptr<SSLConfigService> ssl_config_service;
131 MockClientSocketFactory socket_factory; 133 MockClientSocketFactory socket_factory;
132 scoped_ptr<HttpAuthHandlerFactory> http_auth_handler_factory; 134 scoped_ptr<HttpAuthHandlerFactory> http_auth_handler_factory;
133 scoped_refptr<SpdySessionPool> spdy_session_pool; 135 scoped_refptr<SpdySessionPool> spdy_session_pool;
134 NetLog* net_log; 136 NetLog* net_log;
(...skipping 7307 matching lines...) Expand 10 before | Expand all | Expand 10 after
7442 request.motivation = HttpRequestInfo::PRECONNECT_MOTIVATED; 7444 request.motivation = HttpRequestInfo::PRECONNECT_MOTIVATED;
7443 7445
7444 scoped_ptr<HttpNetworkTransaction> trans(new HttpNetworkTransaction(session)); 7446 scoped_ptr<HttpNetworkTransaction> trans(new HttpNetworkTransaction(session));
7445 7447
7446 int rv = trans->Start(&request, &callback, BoundNetLog()); 7448 int rv = trans->Start(&request, &callback, BoundNetLog());
7447 EXPECT_EQ(ERR_IO_PENDING, rv); 7449 EXPECT_EQ(ERR_IO_PENDING, rv);
7448 EXPECT_EQ(OK, callback.WaitForResult()); 7450 EXPECT_EQ(OK, callback.WaitForResult());
7449 } 7451 }
7450 7452
7451 } // namespace net 7453 } // namespace net
OLDNEW
« no previous file with comments | « net/http/http_auth_unittest.cc ('k') | net/http/http_proxy_client_socket_pool_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698