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

Unified Diff: net/http/http_network_transaction_unittest.cc

Issue 1391053002: [net/http auth] Make HttpAuthHandler challenge handling asynchronous. Base URL: https://chromium.googlesource.com/chromium/src.git@auth-handler-init-split
Patch Set: Created 5 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/http/http_network_transaction.cc ('k') | net/http/http_proxy_client_socket.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_network_transaction_unittest.cc
diff --git a/net/http/http_network_transaction_unittest.cc b/net/http/http_network_transaction_unittest.cc
index 7e50808d9dc0f064ddb3c69fe1646a5d1c2f72de..f9cbf075a151628dd7e3d38572f475509aa54d66 100644
--- a/net/http/http_network_transaction_unittest.cc
+++ b/net/http/http_network_transaction_unittest.cc
@@ -10331,169 +10331,477 @@ TEST_P(HttpNetworkTransactionTest, GenerateAuthToken) {
int first_ssl_round;
TestRound rounds[3];
} test_configs[] = {
- // Non-authenticating HTTP server with a direct connection.
- { NULL, AUTH_NONE, OK, kServer, AUTH_NONE, OK, 1, kNoSSL,
- { TestRound(kGet, kSuccess, OK)}},
- // Authenticating HTTP server with a direct connection.
- { NULL, AUTH_NONE, OK, kServer, AUTH_SYNC, OK, 2, kNoSSL,
- { TestRound(kGet, kServerChallenge, OK),
+ // Non-authenticating HTTP server with a direct connection.
+ {NULL,
+ AUTH_NONE,
+ OK,
+ kServer,
+ AUTH_NONE,
+ OK,
+ 1,
+ kNoSSL,
+ {TestRound(kGet, kSuccess, OK)}},
+ // Authenticating HTTP server with a direct connection.
+ {NULL,
+ AUTH_NONE,
+ OK,
+ kServer,
+ AUTH_SYNC,
+ OK,
+ 2,
+ kNoSSL,
+ {TestRound(kGet, kServerChallenge, OK),
TestRound(kGetAuth, kSuccess, OK)}},
- { NULL, AUTH_NONE, OK, kServer, AUTH_SYNC, kAuthErr, 2, kNoSSL,
- { TestRound(kGet, kServerChallenge, OK),
+ {NULL,
+ AUTH_NONE,
+ OK,
+ kServer,
+ AUTH_SYNC,
+ kAuthErr,
+ 2,
+ kNoSSL,
+ {TestRound(kGet, kServerChallenge, OK),
TestRound(kGetAuth, kFailure, kAuthErr)}},
- { NULL, AUTH_NONE, OK, kServer, AUTH_ASYNC, OK, 2, kNoSSL,
- { TestRound(kGet, kServerChallenge, OK),
+ {NULL,
+ AUTH_NONE,
+ OK,
+ kServer,
+ AUTH_ASYNC,
+ OK,
+ 2,
+ kNoSSL,
+ {TestRound(kGet, kServerChallenge, OK),
TestRound(kGetAuth, kSuccess, OK)}},
- { NULL, AUTH_NONE, OK, kServer, AUTH_ASYNC, kAuthErr, 2, kNoSSL,
- { TestRound(kGet, kServerChallenge, OK),
+ {NULL,
+ AUTH_NONE,
+ OK,
+ kServer,
+ AUTH_ASYNC,
+ kAuthErr,
+ 2,
+ kNoSSL,
+ {TestRound(kGet, kServerChallenge, OK),
TestRound(kGetAuth, kFailure, kAuthErr)}},
- // Non-authenticating HTTP server through a non-authenticating proxy.
- { kProxy, AUTH_NONE, OK, kServer, AUTH_NONE, OK, 1, kNoSSL,
- { TestRound(kGetProxy, kSuccess, OK)}},
- // Authenticating HTTP server through a non-authenticating proxy.
- { kProxy, AUTH_NONE, OK, kServer, AUTH_SYNC, OK, 2, kNoSSL,
- { TestRound(kGetProxy, kServerChallenge, OK),
+ // Non-authenticating HTTP server through a non-authenticating proxy.
+ {kProxy,
+ AUTH_NONE,
+ OK,
+ kServer,
+ AUTH_NONE,
+ OK,
+ 1,
+ kNoSSL,
+ {TestRound(kGetProxy, kSuccess, OK)}},
+ // Authenticating HTTP server through a non-authenticating proxy.
+ {kProxy,
+ AUTH_NONE,
+ OK,
+ kServer,
+ AUTH_SYNC,
+ OK,
+ 2,
+ kNoSSL,
+ {TestRound(kGetProxy, kServerChallenge, OK),
TestRound(kGetAuthThroughProxy, kSuccess, OK)}},
- { kProxy, AUTH_NONE, OK, kServer, AUTH_SYNC, kAuthErr, 2, kNoSSL,
- { TestRound(kGetProxy, kServerChallenge, OK),
+ {kProxy,
+ AUTH_NONE,
+ OK,
+ kServer,
+ AUTH_SYNC,
+ kAuthErr,
+ 2,
+ kNoSSL,
+ {TestRound(kGetProxy, kServerChallenge, OK),
TestRound(kGetAuthThroughProxy, kFailure, kAuthErr)}},
- { kProxy, AUTH_NONE, OK, kServer, AUTH_ASYNC, OK, 2, kNoSSL,
- { TestRound(kGetProxy, kServerChallenge, OK),
+ {kProxy,
+ AUTH_NONE,
+ OK,
+ kServer,
+ AUTH_ASYNC,
+ OK,
+ 2,
+ kNoSSL,
+ {TestRound(kGetProxy, kServerChallenge, OK),
TestRound(kGetAuthThroughProxy, kSuccess, OK)}},
- { kProxy, AUTH_NONE, OK, kServer, AUTH_ASYNC, kAuthErr, 2, kNoSSL,
- { TestRound(kGetProxy, kServerChallenge, OK),
+ {kProxy,
+ AUTH_NONE,
+ OK,
+ kServer,
+ AUTH_ASYNC,
+ kAuthErr,
+ 2,
+ kNoSSL,
+ {TestRound(kGetProxy, kServerChallenge, OK),
TestRound(kGetAuthThroughProxy, kFailure, kAuthErr)}},
- // Non-authenticating HTTP server through an authenticating proxy.
- { kProxy, AUTH_SYNC, OK, kServer, AUTH_NONE, OK, 2, kNoSSL,
- { TestRound(kGetProxy, kProxyChallenge, OK),
+ // Non-authenticating HTTP server through an authenticating proxy.
+ {kProxy,
+ AUTH_SYNC,
+ OK,
+ kServer,
+ AUTH_NONE,
+ OK,
+ 2,
+ kNoSSL,
+ {TestRound(kGetProxy, kProxyChallenge, OK),
TestRound(kGetProxyAuth, kSuccess, OK)}},
- { kProxy, AUTH_SYNC, kAuthErr, kServer, AUTH_NONE, OK, 2, kNoSSL,
- { TestRound(kGetProxy, kProxyChallenge, OK),
+ {kProxy,
+ AUTH_SYNC,
+ kAuthErr,
+ kServer,
+ AUTH_NONE,
+ OK,
+ 2,
+ kNoSSL,
+ {TestRound(kGetProxy, kProxyChallenge, OK),
TestRound(kGetProxyAuth, kFailure, kAuthErr)}},
- { kProxy, AUTH_ASYNC, OK, kServer, AUTH_NONE, OK, 2, kNoSSL,
- { TestRound(kGetProxy, kProxyChallenge, OK),
+ {kProxy,
+ AUTH_ASYNC,
+ OK,
+ kServer,
+ AUTH_NONE,
+ OK,
+ 2,
+ kNoSSL,
+ {TestRound(kGetProxy, kProxyChallenge, OK),
TestRound(kGetProxyAuth, kSuccess, OK)}},
- { kProxy, AUTH_ASYNC, kAuthErr, kServer, AUTH_NONE, OK, 2, kNoSSL,
- { TestRound(kGetProxy, kProxyChallenge, OK),
+ {kProxy,
+ AUTH_ASYNC,
+ kAuthErr,
+ kServer,
+ AUTH_NONE,
+ OK,
+ 2,
+ kNoSSL,
+ {TestRound(kGetProxy, kProxyChallenge, OK),
TestRound(kGetProxyAuth, kFailure, kAuthErr)}},
- // Authenticating HTTP server through an authenticating proxy.
- { kProxy, AUTH_SYNC, OK, kServer, AUTH_SYNC, OK, 3, kNoSSL,
- { TestRound(kGetProxy, kProxyChallenge, OK),
+ // Authenticating HTTP server through an authenticating proxy.
+ {kProxy,
+ AUTH_SYNC,
+ OK,
+ kServer,
+ AUTH_SYNC,
+ OK,
+ 3,
+ kNoSSL,
+ {TestRound(kGetProxy, kProxyChallenge, OK),
TestRound(kGetProxyAuth, kServerChallenge, OK),
TestRound(kGetAuthWithProxyAuth, kSuccess, OK)}},
- { kProxy, AUTH_SYNC, OK, kServer, AUTH_SYNC, kAuthErr, 3, kNoSSL,
- { TestRound(kGetProxy, kProxyChallenge, OK),
+ {kProxy,
+ AUTH_SYNC,
+ OK,
+ kServer,
+ AUTH_SYNC,
+ kAuthErr,
+ 3,
+ kNoSSL,
+ {TestRound(kGetProxy, kProxyChallenge, OK),
TestRound(kGetProxyAuth, kServerChallenge, OK),
TestRound(kGetAuthWithProxyAuth, kFailure, kAuthErr)}},
- { kProxy, AUTH_ASYNC, OK, kServer, AUTH_SYNC, OK, 3, kNoSSL,
- { TestRound(kGetProxy, kProxyChallenge, OK),
+ {kProxy,
+ AUTH_ASYNC,
+ OK,
+ kServer,
+ AUTH_SYNC,
+ OK,
+ 3,
+ kNoSSL,
+ {TestRound(kGetProxy, kProxyChallenge, OK),
TestRound(kGetProxyAuth, kServerChallenge, OK),
TestRound(kGetAuthWithProxyAuth, kSuccess, OK)}},
- { kProxy, AUTH_ASYNC, OK, kServer, AUTH_SYNC, kAuthErr, 3, kNoSSL,
- { TestRound(kGetProxy, kProxyChallenge, OK),
+ {kProxy,
+ AUTH_ASYNC,
+ OK,
+ kServer,
+ AUTH_SYNC,
+ kAuthErr,
+ 3,
+ kNoSSL,
+ {TestRound(kGetProxy, kProxyChallenge, OK),
TestRound(kGetProxyAuth, kServerChallenge, OK),
TestRound(kGetAuthWithProxyAuth, kFailure, kAuthErr)}},
- { kProxy, AUTH_SYNC, OK, kServer, AUTH_ASYNC, OK, 3, kNoSSL,
- { TestRound(kGetProxy, kProxyChallenge, OK),
+ {kProxy,
+ AUTH_SYNC,
+ OK,
+ kServer,
+ AUTH_ASYNC,
+ OK,
+ 3,
+ kNoSSL,
+ {TestRound(kGetProxy, kProxyChallenge, OK),
TestRound(kGetProxyAuth, kServerChallenge, OK),
TestRound(kGetAuthWithProxyAuth, kSuccess, OK)}},
- { kProxy, AUTH_SYNC, OK, kServer, AUTH_ASYNC, kAuthErr, 3, kNoSSL,
- { TestRound(kGetProxy, kProxyChallenge, OK),
+ {kProxy,
+ AUTH_SYNC,
+ OK,
+ kServer,
+ AUTH_ASYNC,
+ kAuthErr,
+ 3,
+ kNoSSL,
+ {TestRound(kGetProxy, kProxyChallenge, OK),
TestRound(kGetProxyAuth, kServerChallenge, OK),
TestRound(kGetAuthWithProxyAuth, kFailure, kAuthErr)}},
- { kProxy, AUTH_ASYNC, OK, kServer, AUTH_ASYNC, OK, 3, kNoSSL,
- { TestRound(kGetProxy, kProxyChallenge, OK),
+ {kProxy,
+ AUTH_ASYNC,
+ OK,
+ kServer,
+ AUTH_ASYNC,
+ OK,
+ 3,
+ kNoSSL,
+ {TestRound(kGetProxy, kProxyChallenge, OK),
TestRound(kGetProxyAuth, kServerChallenge, OK),
TestRound(kGetAuthWithProxyAuth, kSuccess, OK)}},
- { kProxy, AUTH_ASYNC, OK, kServer, AUTH_ASYNC, kAuthErr, 3, kNoSSL,
- { TestRound(kGetProxy, kProxyChallenge, OK),
+ {kProxy,
+ AUTH_ASYNC,
+ OK,
+ kServer,
+ AUTH_ASYNC,
+ kAuthErr,
+ 3,
+ kNoSSL,
+ {TestRound(kGetProxy, kProxyChallenge, OK),
TestRound(kGetProxyAuth, kServerChallenge, OK),
TestRound(kGetAuthWithProxyAuth, kFailure, kAuthErr)}},
- // Non-authenticating HTTPS server with a direct connection.
- { NULL, AUTH_NONE, OK, kSecureServer, AUTH_NONE, OK, 1, 0,
- { TestRound(kGet, kSuccess, OK)}},
- // Authenticating HTTPS server with a direct connection.
- { NULL, AUTH_NONE, OK, kSecureServer, AUTH_SYNC, OK, 2, 0,
- { TestRound(kGet, kServerChallenge, OK),
+ // Non-authenticating HTTPS server with a direct connection.
+ {NULL,
+ AUTH_NONE,
+ OK,
+ kSecureServer,
+ AUTH_NONE,
+ OK,
+ 1,
+ 0,
+ {TestRound(kGet, kSuccess, OK)}},
+ // Authenticating HTTPS server with a direct connection.
+ {NULL,
+ AUTH_NONE,
+ OK,
+ kSecureServer,
+ AUTH_SYNC,
+ OK,
+ 2,
+ 0,
+ {TestRound(kGet, kServerChallenge, OK),
TestRound(kGetAuth, kSuccess, OK)}},
- { NULL, AUTH_NONE, OK, kSecureServer, AUTH_SYNC, kAuthErr, 2, 0,
- { TestRound(kGet, kServerChallenge, OK),
+ {NULL,
+ AUTH_NONE,
+ OK,
+ kSecureServer,
+ AUTH_SYNC,
+ kAuthErr,
+ 2,
+ 0,
+ {TestRound(kGet, kServerChallenge, OK),
TestRound(kGetAuth, kFailure, kAuthErr)}},
- { NULL, AUTH_NONE, OK, kSecureServer, AUTH_ASYNC, OK, 2, 0,
- { TestRound(kGet, kServerChallenge, OK),
+ {NULL,
+ AUTH_NONE,
+ OK,
+ kSecureServer,
+ AUTH_ASYNC,
+ OK,
+ 2,
+ 0,
+ {TestRound(kGet, kServerChallenge, OK),
TestRound(kGetAuth, kSuccess, OK)}},
- { NULL, AUTH_NONE, OK, kSecureServer, AUTH_ASYNC, kAuthErr, 2, 0,
- { TestRound(kGet, kServerChallenge, OK),
+ {NULL,
+ AUTH_NONE,
+ OK,
+ kSecureServer,
+ AUTH_ASYNC,
+ kAuthErr,
+ 2,
+ 0,
+ {TestRound(kGet, kServerChallenge, OK),
TestRound(kGetAuth, kFailure, kAuthErr)}},
- // Non-authenticating HTTPS server with a non-authenticating proxy.
- { kProxy, AUTH_NONE, OK, kSecureServer, AUTH_NONE, OK, 1, 0,
- { TestRound(kConnect, kProxyConnected, OK, &kGet, &kSuccess)}},
- // Authenticating HTTPS server through a non-authenticating proxy.
- { kProxy, AUTH_NONE, OK, kSecureServer, AUTH_SYNC, OK, 2, 0,
- { TestRound(kConnect, kProxyConnected, OK, &kGet, &kServerChallenge),
+ // Non-authenticating HTTPS server with a non-authenticating proxy.
+ {kProxy,
+ AUTH_NONE,
+ OK,
+ kSecureServer,
+ AUTH_NONE,
+ OK,
+ 1,
+ 0,
+ {TestRound(kConnect, kProxyConnected, OK, &kGet, &kSuccess)}},
+ // Authenticating HTTPS server through a non-authenticating proxy.
+ {kProxy,
+ AUTH_NONE,
+ OK,
+ kSecureServer,
+ AUTH_SYNC,
+ OK,
+ 2,
+ 0,
+ {TestRound(kConnect, kProxyConnected, OK, &kGet, &kServerChallenge),
TestRound(kGetAuth, kSuccess, OK)}},
- { kProxy, AUTH_NONE, OK, kSecureServer, AUTH_SYNC, kAuthErr, 2, 0,
- { TestRound(kConnect, kProxyConnected, OK, &kGet, &kServerChallenge),
+ {kProxy,
+ AUTH_NONE,
+ OK,
+ kSecureServer,
+ AUTH_SYNC,
+ kAuthErr,
+ 2,
+ 0,
+ {TestRound(kConnect, kProxyConnected, OK, &kGet, &kServerChallenge),
TestRound(kGetAuth, kFailure, kAuthErr)}},
- { kProxy, AUTH_NONE, OK, kSecureServer, AUTH_ASYNC, OK, 2, 0,
- { TestRound(kConnect, kProxyConnected, OK, &kGet, &kServerChallenge),
+ {kProxy,
+ AUTH_NONE,
+ OK,
+ kSecureServer,
+ AUTH_ASYNC,
+ OK,
+ 2,
+ 0,
+ {TestRound(kConnect, kProxyConnected, OK, &kGet, &kServerChallenge),
TestRound(kGetAuth, kSuccess, OK)}},
- { kProxy, AUTH_NONE, OK, kSecureServer, AUTH_ASYNC, kAuthErr, 2, 0,
- { TestRound(kConnect, kProxyConnected, OK, &kGet, &kServerChallenge),
+ {kProxy,
+ AUTH_NONE,
+ OK,
+ kSecureServer,
+ AUTH_ASYNC,
+ kAuthErr,
+ 2,
+ 0,
+ {TestRound(kConnect, kProxyConnected, OK, &kGet, &kServerChallenge),
TestRound(kGetAuth, kFailure, kAuthErr)}},
- // Non-Authenticating HTTPS server through an authenticating proxy.
- { kProxy, AUTH_SYNC, OK, kSecureServer, AUTH_NONE, OK, 2, 1,
- { TestRound(kConnect, kProxyChallenge, OK),
+ // Non-Authenticating HTTPS server through an authenticating proxy.
+ {kProxy,
+ AUTH_SYNC,
+ OK,
+ kSecureServer,
+ AUTH_NONE,
+ OK,
+ 2,
+ 1,
+ {TestRound(kConnect, kProxyChallenge, OK),
TestRound(kConnectProxyAuth, kProxyConnected, OK, &kGet, &kSuccess)}},
- { kProxy, AUTH_SYNC, kAuthErr, kSecureServer, AUTH_NONE, OK, 2, kNoSSL,
- { TestRound(kConnect, kProxyChallenge, OK),
+ {kProxy,
+ AUTH_SYNC,
+ kAuthErr,
+ kSecureServer,
+ AUTH_NONE,
+ OK,
+ 2,
+ kNoSSL,
+ {TestRound(kConnect, kProxyChallenge, OK),
TestRound(kConnectProxyAuth, kFailure, kAuthErr)}},
- { kProxy, AUTH_ASYNC, OK, kSecureServer, AUTH_NONE, OK, 2, 1,
- { TestRound(kConnect, kProxyChallenge, OK),
+ {kProxy,
+ AUTH_ASYNC,
+ OK,
+ kSecureServer,
+ AUTH_NONE,
+ OK,
+ 2,
+ 1,
+ {TestRound(kConnect, kProxyChallenge, OK),
TestRound(kConnectProxyAuth, kProxyConnected, OK, &kGet, &kSuccess)}},
- { kProxy, AUTH_ASYNC, kAuthErr, kSecureServer, AUTH_NONE, OK, 2, kNoSSL,
- { TestRound(kConnect, kProxyChallenge, OK),
+ {kProxy,
+ AUTH_ASYNC,
+ kAuthErr,
+ kSecureServer,
+ AUTH_NONE,
+ OK,
+ 2,
+ kNoSSL,
+ {TestRound(kConnect, kProxyChallenge, OK),
TestRound(kConnectProxyAuth, kFailure, kAuthErr)}},
- // Authenticating HTTPS server through an authenticating proxy.
- { kProxy, AUTH_SYNC, OK, kSecureServer, AUTH_SYNC, OK, 3, 1,
- { TestRound(kConnect, kProxyChallenge, OK),
- TestRound(kConnectProxyAuth, kProxyConnected, OK,
- &kGet, &kServerChallenge),
+ // Authenticating HTTPS server through an authenticating proxy.
+ {kProxy,
+ AUTH_SYNC,
+ OK,
+ kSecureServer,
+ AUTH_SYNC,
+ OK,
+ 3,
+ 1,
+ {TestRound(kConnect, kProxyChallenge, OK),
+ TestRound(kConnectProxyAuth, kProxyConnected, OK, &kGet,
+ &kServerChallenge),
TestRound(kGetAuth, kSuccess, OK)}},
- { kProxy, AUTH_SYNC, OK, kSecureServer, AUTH_SYNC, kAuthErr, 3, 1,
- { TestRound(kConnect, kProxyChallenge, OK),
- TestRound(kConnectProxyAuth, kProxyConnected, OK,
- &kGet, &kServerChallenge),
+ {kProxy,
+ AUTH_SYNC,
+ OK,
+ kSecureServer,
+ AUTH_SYNC,
+ kAuthErr,
+ 3,
+ 1,
+ {TestRound(kConnect, kProxyChallenge, OK),
+ TestRound(kConnectProxyAuth, kProxyConnected, OK, &kGet,
+ &kServerChallenge),
TestRound(kGetAuth, kFailure, kAuthErr)}},
- { kProxy, AUTH_ASYNC, OK, kSecureServer, AUTH_SYNC, OK, 3, 1,
- { TestRound(kConnect, kProxyChallenge, OK),
- TestRound(kConnectProxyAuth, kProxyConnected, OK,
- &kGet, &kServerChallenge),
+ {kProxy,
+ AUTH_ASYNC,
+ OK,
+ kSecureServer,
+ AUTH_SYNC,
+ OK,
+ 3,
+ 1,
+ {TestRound(kConnect, kProxyChallenge, OK),
+ TestRound(kConnectProxyAuth, kProxyConnected, OK, &kGet,
+ &kServerChallenge),
TestRound(kGetAuth, kSuccess, OK)}},
- { kProxy, AUTH_ASYNC, OK, kSecureServer, AUTH_SYNC, kAuthErr, 3, 1,
- { TestRound(kConnect, kProxyChallenge, OK),
- TestRound(kConnectProxyAuth, kProxyConnected, OK,
- &kGet, &kServerChallenge),
+ {kProxy,
+ AUTH_ASYNC,
+ OK,
+ kSecureServer,
+ AUTH_SYNC,
+ kAuthErr,
+ 3,
+ 1,
+ {TestRound(kConnect, kProxyChallenge, OK),
+ TestRound(kConnectProxyAuth, kProxyConnected, OK, &kGet,
+ &kServerChallenge),
TestRound(kGetAuth, kFailure, kAuthErr)}},
- { kProxy, AUTH_SYNC, OK, kSecureServer, AUTH_ASYNC, OK, 3, 1,
- { TestRound(kConnect, kProxyChallenge, OK),
- TestRound(kConnectProxyAuth, kProxyConnected, OK,
- &kGet, &kServerChallenge),
+ {kProxy,
+ AUTH_SYNC,
+ OK,
+ kSecureServer,
+ AUTH_ASYNC,
+ OK,
+ 3,
+ 1,
+ {TestRound(kConnect, kProxyChallenge, OK),
+ TestRound(kConnectProxyAuth, kProxyConnected, OK, &kGet,
+ &kServerChallenge),
TestRound(kGetAuth, kSuccess, OK)}},
- { kProxy, AUTH_SYNC, OK, kSecureServer, AUTH_ASYNC, kAuthErr, 3, 1,
- { TestRound(kConnect, kProxyChallenge, OK),
- TestRound(kConnectProxyAuth, kProxyConnected, OK,
- &kGet, &kServerChallenge),
+ {kProxy,
+ AUTH_SYNC,
+ OK,
+ kSecureServer,
+ AUTH_ASYNC,
+ kAuthErr,
+ 3,
+ 1,
+ {TestRound(kConnect, kProxyChallenge, OK),
+ TestRound(kConnectProxyAuth, kProxyConnected, OK, &kGet,
+ &kServerChallenge),
TestRound(kGetAuth, kFailure, kAuthErr)}},
- { kProxy, AUTH_ASYNC, OK, kSecureServer, AUTH_ASYNC, OK, 3, 1,
- { TestRound(kConnect, kProxyChallenge, OK),
- TestRound(kConnectProxyAuth, kProxyConnected, OK,
- &kGet, &kServerChallenge),
+ {kProxy,
+ AUTH_ASYNC,
+ OK,
+ kSecureServer,
+ AUTH_ASYNC,
+ OK,
+ 3,
+ 1,
+ {TestRound(kConnect, kProxyChallenge, OK),
+ TestRound(kConnectProxyAuth, kProxyConnected, OK, &kGet,
+ &kServerChallenge),
TestRound(kGetAuth, kSuccess, OK)}},
- { kProxy, AUTH_ASYNC, OK, kSecureServer, AUTH_ASYNC, kAuthErr, 3, 1,
- { TestRound(kConnect, kProxyChallenge, OK),
- TestRound(kConnectProxyAuth, kProxyConnected, OK,
- &kGet, &kServerChallenge),
+ {kProxy,
+ AUTH_ASYNC,
+ OK,
+ kSecureServer,
+ AUTH_ASYNC,
+ kAuthErr,
+ 3,
+ 1,
+ {TestRound(kConnect, kProxyChallenge, OK),
+ TestRound(kConnectProxyAuth, kProxyConnected, OK, &kGet,
+ &kServerChallenge),
TestRound(kGetAuth, kFailure, kAuthErr)}},
};
@@ -10519,6 +10827,8 @@ TEST_P(HttpNetworkTransactionTest, GenerateAuthToken) {
}
if (test_config.server_auth_timing != AUTH_NONE) {
scoped_ptr<HttpAuthHandlerMock> auth_handler(new HttpAuthHandlerMock());
+ auth_handler->SetInitExpectation(
+ test_config.server_auth_timing == AUTH_ASYNC, OK);
auth_handler->SetGenerateExpectation(
test_config.server_auth_timing == AUTH_ASYNC,
test_config.server_auth_rv);
@@ -10593,8 +10903,7 @@ TEST_P(HttpNetworkTransactionTest, GenerateAuthToken) {
rv = trans.RestartWithAuth(
AuthCredentials(kFoo, kBar), callback.callback());
}
- if (rv == ERR_IO_PENDING)
- rv = callback.WaitForResult();
+ rv = callback.GetResult(rv);
// Compare results with expected data.
EXPECT_EQ(read_write_round.expected_rv, rv);
@@ -10776,8 +11085,11 @@ TEST_P(HttpNetworkTransactionTest, MultiRoundAuth) {
// will be handed it immediately after trans releases it to the group.
EXPECT_EQ(0, transport_pool->IdleSocketCountInGroup(kSocketGroup));
- // The competing request can now finish. Wait for the headers and then
- // read the body.
+ // The competing request can now finish. Wait for the headers and then read
+ // the body. Explicitly ignore the request to create a preemptive auth handler
+ // for the competing request.
+ auth_factory->AddMockHandler(scoped_ptr<HttpAuthHandler>(),
+ HttpAuthHandlerCreateReason::PREEMPTIVE);
rv = callback_compete.WaitForResult();
EXPECT_EQ(OK, rv);
rv = trans_compete->Read(io_buf.get(), io_buf->size(), callback.callback());
@@ -10933,6 +11245,10 @@ TEST_P(HttpNetworkTransactionTest, SpdyAlternateProtocolThroughProxy) {
new UrlRecordingHttpAuthHandlerMock(&request_url));
auth_factory->AddMockHandler(auth_handler.Pass(),
HttpAuthHandlerCreateReason::CHALLENGE);
+
+ // Explicitly ignore the request to create a preemptive auth handler.
+ auth_factory->AddMockHandler(scoped_ptr<HttpAuthHandler>(),
+ HttpAuthHandlerCreateReason::PREEMPTIVE);
session_deps_.http_auth_handler_factory.reset(auth_factory);
}
« no previous file with comments | « net/http/http_network_transaction.cc ('k') | net/http/http_proxy_client_socket.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698