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

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

Issue 8340026: Use AuthCredentials throughout the network stack instead of username/password. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Reduce password zapping Created 9 years, 1 month 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/string_util.h" 9 #include "base/string_util.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 } 95 }
96 96
97 void AddAuthToCache() { 97 void AddAuthToCache() {
98 const string16 kFoo(ASCIIToUTF16("foo")); 98 const string16 kFoo(ASCIIToUTF16("foo"));
99 const string16 kBar(ASCIIToUTF16("bar")); 99 const string16 kBar(ASCIIToUTF16("bar"));
100 GURL proxy_url(GetParam() == HTTP ? "http://proxy" : "https://proxy:80"); 100 GURL proxy_url(GetParam() == HTTP ? "http://proxy" : "https://proxy:80");
101 session_->http_auth_cache()->Add(proxy_url, 101 session_->http_auth_cache()->Add(proxy_url,
102 "MyRealm1", 102 "MyRealm1",
103 HttpAuth::AUTH_SCHEME_BASIC, 103 HttpAuth::AUTH_SCHEME_BASIC,
104 "Basic realm=MyRealm1", 104 "Basic realm=MyRealm1",
105 kFoo, 105 AuthCredentials(kFoo, kBar),
106 kBar,
107 "/"); 106 "/");
108 } 107 }
109 108
110 scoped_refptr<TransportSocketParams> GetTcpParams() { 109 scoped_refptr<TransportSocketParams> GetTcpParams() {
111 if (GetParam() != HTTP) 110 if (GetParam() != HTTP)
112 return scoped_refptr<TransportSocketParams>(); 111 return scoped_refptr<TransportSocketParams>();
113 return ignored_transport_socket_params_; 112 return ignored_transport_socket_params_;
114 } 113 }
115 114
116 scoped_refptr<SSLSocketParams> GetSslParams() { 115 scoped_refptr<SSLSocketParams> GetSslParams() {
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after
521 // HTTPS or SPDY Proxy CONNECT responses are trustworthy 520 // HTTPS or SPDY Proxy CONNECT responses are trustworthy
522 EXPECT_EQ(ERR_HTTPS_PROXY_TUNNEL_RESPONSE, rv); 521 EXPECT_EQ(ERR_HTTPS_PROXY_TUNNEL_RESPONSE, rv);
523 EXPECT_TRUE(handle_.is_initialized()); 522 EXPECT_TRUE(handle_.is_initialized());
524 EXPECT_TRUE(handle_.socket()); 523 EXPECT_TRUE(handle_.socket());
525 } 524 }
526 } 525 }
527 526
528 // It would be nice to also test the timeouts in HttpProxyClientSocketPool. 527 // It would be nice to also test the timeouts in HttpProxyClientSocketPool.
529 528
530 } // namespace net 529 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698