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

Unified Diff: net/url_request/url_request_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: Fix comments Created 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/url_request/url_request_test_util.cc ('k') | net/websockets/websocket_job.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/url_request/url_request_unittest.cc
diff --git a/net/url_request/url_request_unittest.cc b/net/url_request/url_request_unittest.cc
index 53ba466b844caec3dfbbc9eeaaa680c879be7240..fbd6d278a972689eacf5e75595c685b34af5e444 100644
--- a/net/url_request/url_request_unittest.cc
+++ b/net/url_request/url_request_unittest.cc
@@ -599,8 +599,7 @@ TEST_F(URLRequestTestHTTP, NetworkDelegateOnAuthRequiredSyncNoAction) {
context->set_network_delegate(&network_delegate);
context->Init();
- d.set_username(kUser);
- d.set_password(kSecret);
+ d.set_credentials(AuthCredentials(kUser, kSecret));
{
GURL url(test_server_.GetURL("auth-basic"));
@@ -629,10 +628,7 @@ TEST_F(URLRequestTestHTTP, NetworkDelegateOnAuthRequiredSyncSetAuth) {
network_delegate.set_auth_retval(
NetworkDelegate::AUTH_REQUIRED_RESPONSE_SET_AUTH);
- AuthCredentials auth_credentials;
- auth_credentials.username = kUser;
- auth_credentials.password = kSecret;
- network_delegate.set_auth_credentials(auth_credentials);
+ network_delegate.set_auth_credentials(AuthCredentials(kUser, kSecret));
scoped_refptr<TestURLRequestContext> context(new TestURLRequestContext(true));
context->set_network_delegate(&network_delegate);
@@ -704,8 +700,7 @@ TEST_F(URLRequestTestHTTP, NetworkDelegateOnAuthRequiredAsyncNoAction) {
context->set_network_delegate(&network_delegate);
context->Init();
- d.set_username(kUser);
- d.set_password(kSecret);
+ d.set_credentials(AuthCredentials(kUser, kSecret));
{
GURL url(test_server_.GetURL("auth-basic"));
@@ -736,9 +731,7 @@ TEST_F(URLRequestTestHTTP, NetworkDelegateOnAuthRequiredAsyncSetAuth) {
network_delegate.set_auth_callback_retval(
NetworkDelegate::AUTH_REQUIRED_RESPONSE_SET_AUTH);
- AuthCredentials auth_credentials;
- auth_credentials.username = kUser;
- auth_credentials.password = kSecret;
+ AuthCredentials auth_credentials(kUser, kSecret);
network_delegate.set_auth_credentials(auth_credentials);
scoped_refptr<TestURLRequestContext> context(new TestURLRequestContext(true));
@@ -1951,8 +1944,7 @@ TEST_F(URLRequestTestHTTP, BasicAuth) {
// populate the cache
{
TestDelegate d;
- d.set_username(kUser);
- d.set_password(kSecret);
+ d.set_credentials(AuthCredentials(kUser, kSecret));
URLRequest r(test_server_.GetURL("auth-basic"), &d);
r.set_context(default_context_);
@@ -1968,8 +1960,7 @@ TEST_F(URLRequestTestHTTP, BasicAuth) {
// response should be fetched from the cache.
{
TestDelegate d;
- d.set_username(kUser);
- d.set_password(kSecret);
+ d.set_credentials(AuthCredentials(kUser, kSecret));
URLRequest r(test_server_.GetURL("auth-basic"), &d);
r.set_context(default_context_);
@@ -2003,8 +1994,7 @@ TEST_F(URLRequestTestHTTP, BasicAuthWithCookies) {
context->Init();
TestDelegate d;
- d.set_username(kUser);
- d.set_password(kSecret);
+ d.set_credentials(AuthCredentials(kUser, kSecret));
URLRequest r(url_requiring_auth, &d);
r.set_context(context);
@@ -3270,8 +3260,7 @@ TEST_F(URLRequestTestFTP, FLAKY_FTPCheckWrongPasswordRestart) {
TestDelegate d;
// Set correct login credentials. The delegate will be asked for them when
// the initial login with wrong credentials will fail.
- d.set_username(kChrome);
- d.set_password(kChrome);
+ d.set_credentials(AuthCredentials(kChrome, kChrome));
{
TestURLRequest r(
test_server_.GetURLWithUserAndPassword("/LICENSE",
@@ -3334,8 +3323,7 @@ TEST_F(URLRequestTestFTP, FLAKY_FTPCheckWrongUserRestart) {
TestDelegate d;
// Set correct login credentials. The delegate will be asked for them when
// the initial login with wrong credentials will fail.
- d.set_username(kChrome);
- d.set_password(kChrome);
+ d.set_credentials(AuthCredentials(kChrome, kChrome));
{
TestURLRequest r(
test_server_.GetURLWithUserAndPassword("/LICENSE",
@@ -3420,8 +3408,7 @@ TEST_F(URLRequestTestFTP, FLAKY_FTPCacheLoginBoxCredentials) {
scoped_ptr<TestDelegate> d(new TestDelegate);
// Set correct login credentials. The delegate will be asked for them when
// the initial login with wrong credentials will fail.
- d->set_username(kChrome);
- d->set_password(kChrome);
+ d->set_credentials(AuthCredentials(kChrome, kChrome));
{
TestURLRequest r(
test_server_.GetURLWithUserAndPassword("/LICENSE",
« no previous file with comments | « net/url_request/url_request_test_util.cc ('k') | net/websockets/websocket_job.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698