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/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 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 | 182 |
183 virtual ~HttpProxyClientSocketPoolTest() { | 183 virtual ~HttpProxyClientSocketPoolTest() { |
184 } | 184 } |
185 | 185 |
186 void AddAuthToCache() { | 186 void AddAuthToCache() { |
187 const base::string16 kFoo(base::ASCIIToUTF16("foo")); | 187 const base::string16 kFoo(base::ASCIIToUTF16("foo")); |
188 const base::string16 kBar(base::ASCIIToUTF16("bar")); | 188 const base::string16 kBar(base::ASCIIToUTF16("bar")); |
189 GURL proxy_url(GetParam().proxy_type == HTTP ? | 189 GURL proxy_url(GetParam().proxy_type == HTTP ? |
190 (std::string("http://") + kHttpProxyHost) : | 190 (std::string("http://") + kHttpProxyHost) : |
191 (std::string("https://") + kHttpsProxyHost)); | 191 (std::string("https://") + kHttpsProxyHost)); |
192 session_->http_auth_cache()->Add(proxy_url, | 192 session_->http_auth_cache()->Add(proxy_url, "MyRealm1", "basic", |
193 "MyRealm1", | |
194 HttpAuth::AUTH_SCHEME_BASIC, | |
195 "Basic realm=MyRealm1", | 193 "Basic realm=MyRealm1", |
196 AuthCredentials(kFoo, kBar), | 194 AuthCredentials(kFoo, kBar), "/"); |
197 "/"); | |
198 } | 195 } |
199 | 196 |
200 scoped_refptr<TransportSocketParams> CreateHttpProxyParams() const { | 197 scoped_refptr<TransportSocketParams> CreateHttpProxyParams() const { |
201 if (GetParam().proxy_type != HTTP) | 198 if (GetParam().proxy_type != HTTP) |
202 return NULL; | 199 return NULL; |
203 return new TransportSocketParams( | 200 return new TransportSocketParams( |
204 HostPortPair(kHttpProxyHost, 80), | 201 HostPortPair(kHttpProxyHost, 80), |
205 false, | 202 false, |
206 false, | 203 false, |
207 OnHostResolutionCallback(), | 204 OnHostResolutionCallback(), |
(...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
812 EXPECT_TRUE(headers->IsRedirect(&location)); | 809 EXPECT_TRUE(headers->IsRedirect(&location)); |
813 EXPECT_EQ(location, redirectTarget); | 810 EXPECT_EQ(location, redirectTarget); |
814 } | 811 } |
815 } | 812 } |
816 | 813 |
817 // It would be nice to also test the timeouts in HttpProxyClientSocketPool. | 814 // It would be nice to also test the timeouts in HttpProxyClientSocketPool. |
818 | 815 |
819 } // namespace | 816 } // namespace |
820 | 817 |
821 } // namespace net | 818 } // namespace net |
OLD | NEW |