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

Unified Diff: net/http/http_auth_controller_unittest.cc

Issue 1393693002: [net/http auth] Split HttpAuthHandler creation from initialization. Base URL: https://chromium.googlesource.com/chromium/src.git@rename-auth-handler-methods
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_auth_controller.cc ('k') | net/http/http_auth_handler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_auth_controller_unittest.cc
diff --git a/net/http/http_auth_controller_unittest.cc b/net/http/http_auth_controller_unittest.cc
index 32a92bc1ed2f2ee45f5b287a3a35e85a5cd9a7ab..1235156a38a5bd52b87aa88944aeed666900cb07 100644
--- a/net/http/http_auth_controller_unittest.cc
+++ b/net/http/http_auth_controller_unittest.cc
@@ -66,8 +66,7 @@ void RunSingleRoundAuthTest(HandlerRunMode run_mode,
auth_handler->SetGenerateExpectation((run_mode == RUN_HANDLER_ASYNC),
handler_rv);
auth_handler_factory.AddMockHandler(auth_handler.Pass(),
- HttpAuthHandlerFactory::CREATE_CHALLENGE,
- HttpAuth::AUTH_PROXY);
+ HttpAuthHandlerCreateReason::CHALLENGE);
scoped_refptr<HttpAuthController> controller(
new HttpAuthController(HttpAuth::AUTH_PROXY,
@@ -143,8 +142,7 @@ TEST(HttpAuthControllerTest, NoExplicitCredentialsAllowed) {
auth_handler->set_allows_explicit_credentials(false);
auth_handler->set_expected_auth_scheme("ernie");
auth_handler_factory.AddMockHandler(auth_handler.Pass(),
- HttpAuthHandlerFactory::CREATE_CHALLENGE,
- HttpAuth::AUTH_SERVER);
+ HttpAuthHandlerCreateReason::CHALLENGE);
scoped_refptr<HttpAuthController> controller(
new HttpAuthController(HttpAuth::AUTH_SERVER,
@@ -155,7 +153,7 @@ TEST(HttpAuthControllerTest, NoExplicitCredentialsAllowed) {
ASSERT_TRUE(controller->HaveAuthHandler());
controller->ResetAuth(AuthCredentials());
EXPECT_TRUE(controller->HaveAuth());
- EXPECT_FALSE(auth_handler_factory.HaveAuthHandlers(HttpAuth::AUTH_SERVER));
+ EXPECT_FALSE(auth_handler_factory.HaveAuthHandlers());
// Should only succeed if we are using the "Ernie" MockHandler.
EXPECT_EQ(OK, controller->MaybeGenerateAuthToken(
@@ -170,8 +168,7 @@ TEST(HttpAuthControllerTest, NoExplicitCredentialsAllowed) {
auth_handler->set_allows_explicit_credentials(false);
auth_handler->set_expected_auth_scheme("ernie");
auth_handler_factory.AddMockHandler(auth_handler.Pass(),
- HttpAuthHandlerFactory::CREATE_CHALLENGE,
- HttpAuth::AUTH_SERVER);
+ HttpAuthHandlerCreateReason::CHALLENGE);
// Fallback handlers for the second attempt. The "Ernie" handler should be
// discarded due to the disabled scheme, and the "Bert" handler should
@@ -181,8 +178,7 @@ TEST(HttpAuthControllerTest, NoExplicitCredentialsAllowed) {
auth_handler->set_allows_explicit_credentials(true);
auth_handler->set_expected_auth_scheme("bert");
auth_handler_factory.AddMockHandler(auth_handler.Pass(),
- HttpAuthHandlerFactory::CREATE_CHALLENGE,
- HttpAuth::AUTH_SERVER);
+ HttpAuthHandlerCreateReason::CHALLENGE);
// Once a token is generated, simulate the receipt of a server response
// indicating that the authentication attempt was rejected.
« no previous file with comments | « net/http/http_auth_controller.cc ('k') | net/http/http_auth_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698