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

Unified Diff: net/http/http_auth_controller_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, 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
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 d1c82dcffa01fe2ef2ff533ba2aead1109b0cca6..392d9ab4a2425b9715ec5c1fa2b17289a2ef0938 100644
--- a/net/http/http_auth_controller_unittest.cc
+++ b/net/http/http_auth_controller_unittest.cc
@@ -74,7 +74,7 @@ void RunSingleRoundAuthTest(HandlerRunMode run_mode,
ASSERT_EQ(OK,
controller->HandleAuthChallenge(headers, false, false, dummy_log));
ASSERT_TRUE(controller->HaveAuthHandler());
- controller->ResetAuth(string16(), string16());
+ controller->ResetAuth(AuthCredentials());
EXPECT_TRUE(controller->HaveAuth());
TestOldCompletionCallback callback;
@@ -142,17 +142,17 @@ TEST(HttpAuthControllerTest, NoExplicitCredentialsAllowed) {
return true;
}
- virtual int GenerateAuthTokenImpl(const string16* username,
- const string16* password,
+ virtual int GenerateAuthTokenImpl(const AuthCredentials* credentials,
const HttpRequestInfo* request,
OldCompletionCallback* callback,
std::string* auth_token) OVERRIDE {
int result =
- HttpAuthHandlerMock::GenerateAuthTokenImpl(username, password,
+ HttpAuthHandlerMock::GenerateAuthTokenImpl(credentials,
request, callback,
auth_token);
EXPECT_TRUE(result != OK ||
- !AllowsExplicitCredentials() || !username->empty());
+ !AllowsExplicitCredentials() ||
+ !credentials->Empty());
return result;
}
@@ -211,7 +211,7 @@ TEST(HttpAuthControllerTest, NoExplicitCredentialsAllowed) {
ASSERT_EQ(OK,
controller->HandleAuthChallenge(headers, false, false, dummy_log));
ASSERT_TRUE(controller->HaveAuthHandler());
- controller->ResetAuth(string16(), string16());
+ controller->ResetAuth(AuthCredentials());
EXPECT_TRUE(controller->HaveAuth());
// Should only succeed if we are using the AUTH_SCHEME_MOCK MockHandler.
@@ -223,7 +223,7 @@ TEST(HttpAuthControllerTest, NoExplicitCredentialsAllowed) {
ASSERT_EQ(OK,
controller->HandleAuthChallenge(headers, false, false, dummy_log));
ASSERT_TRUE(controller->HaveAuthHandler());
- controller->ResetAuth(ASCIIToUTF16("Hello"), string16());
+ controller->ResetAuth(AuthCredentials(ASCIIToUTF16("Hello"), string16()));
EXPECT_TRUE(controller->HaveAuth());
EXPECT_TRUE(controller->IsAuthSchemeDisabled(HttpAuth::AUTH_SCHEME_MOCK));
EXPECT_FALSE(controller->IsAuthSchemeDisabled(HttpAuth::AUTH_SCHEME_BASIC));

Powered by Google App Engine
This is Rietveld 408576698