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

Unified Diff: net/http/http_network_transaction_unittest.cc

Issue 1414313002: Allow dynamic updating of authentication policies (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Respond to cbentzel@'s comments. Created 5 years 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_log_util.cc ('k') | net/http/mock_allow_http_auth_preferences.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 f310d57598163de28d8fb3845a175c4c85f1b9e2..d71aec7460c465d119fa45a3410234862bad7a8c 100644
--- a/net/http/http_network_transaction_unittest.cc
+++ b/net/http/http_network_transaction_unittest.cc
@@ -43,6 +43,7 @@
#include "net/http/http_auth_handler_digest.h"
#include "net/http/http_auth_handler_mock.h"
#include "net/http/http_auth_handler_ntlm.h"
+#include "net/http/http_auth_scheme.h"
#include "net/http/http_basic_state.h"
#include "net/http/http_basic_stream.h"
#include "net/http/http_network_session.h"
@@ -667,7 +668,7 @@ bool CheckBasicServerAuth(const AuthChallengeInfo* auth_challenge) {
EXPECT_FALSE(auth_challenge->is_proxy);
EXPECT_EQ("www.example.org:80", auth_challenge->challenger.ToString());
EXPECT_EQ("MyRealm1", auth_challenge->realm);
- EXPECT_EQ("basic", auth_challenge->scheme);
+ EXPECT_EQ(kBasicAuthScheme, auth_challenge->scheme);
return true;
}
@@ -677,7 +678,7 @@ bool CheckBasicProxyAuth(const AuthChallengeInfo* auth_challenge) {
EXPECT_TRUE(auth_challenge->is_proxy);
EXPECT_EQ("myproxy:70", auth_challenge->challenger.ToString());
EXPECT_EQ("MyRealm1", auth_challenge->realm);
- EXPECT_EQ("basic", auth_challenge->scheme);
+ EXPECT_EQ(kBasicAuthScheme, auth_challenge->scheme);
return true;
}
@@ -687,7 +688,7 @@ bool CheckDigestServerAuth(const AuthChallengeInfo* auth_challenge) {
EXPECT_FALSE(auth_challenge->is_proxy);
EXPECT_EQ("www.example.org:80", auth_challenge->challenger.ToString());
EXPECT_EQ("digestive", auth_challenge->realm);
- EXPECT_EQ("digest", auth_challenge->scheme);
+ EXPECT_EQ(kDigestAuthScheme, auth_challenge->scheme);
return true;
}
@@ -698,7 +699,7 @@ bool CheckNTLMServerAuth(const AuthChallengeInfo* auth_challenge) {
EXPECT_FALSE(auth_challenge->is_proxy);
EXPECT_EQ("172.22.68.17:80", auth_challenge->challenger.ToString());
EXPECT_EQ(std::string(), auth_challenge->realm);
- EXPECT_EQ("ntlm", auth_challenge->scheme);
+ EXPECT_EQ(kNtlmAuthScheme, auth_challenge->scheme);
return true;
}
#endif // defined(NTLM_PORTABLE)
@@ -6525,7 +6526,7 @@ TEST_P(HttpNetworkTransactionTest, BasicAuthCacheAndPreauth) {
EXPECT_EQ("www.example.org:80",
response->auth_challenge->challenger.ToString());
EXPECT_EQ("MyRealm2", response->auth_challenge->realm);
- EXPECT_EQ("basic", response->auth_challenge->scheme);
+ EXPECT_EQ(kBasicAuthScheme, response->auth_challenge->scheme);
TestCompletionCallback callback2;
@@ -9355,7 +9356,7 @@ TEST_P(HttpNetworkTransactionTest, ChangeAuthRealms) {
EXPECT_FALSE(challenge->is_proxy);
EXPECT_EQ("www.example.org:80", challenge->challenger.ToString());
EXPECT_EQ("first_realm", challenge->realm);
- EXPECT_EQ("basic", challenge->scheme);
+ EXPECT_EQ(kBasicAuthScheme, challenge->scheme);
// Issue the second request with an incorrect password. There should be a
// password prompt for second_realm waiting to be filled in after the
@@ -9373,7 +9374,7 @@ TEST_P(HttpNetworkTransactionTest, ChangeAuthRealms) {
EXPECT_FALSE(challenge->is_proxy);
EXPECT_EQ("www.example.org:80", challenge->challenger.ToString());
EXPECT_EQ("second_realm", challenge->realm);
- EXPECT_EQ("basic", challenge->scheme);
+ EXPECT_EQ(kBasicAuthScheme, challenge->scheme);
// Issue the third request with another incorrect password. There should be
// a password prompt for first_realm waiting to be filled in. If the password
@@ -9392,7 +9393,7 @@ TEST_P(HttpNetworkTransactionTest, ChangeAuthRealms) {
EXPECT_FALSE(challenge->is_proxy);
EXPECT_EQ("www.example.org:80", challenge->challenger.ToString());
EXPECT_EQ("first_realm", challenge->realm);
- EXPECT_EQ("basic", challenge->scheme);
+ EXPECT_EQ(kBasicAuthScheme, challenge->scheme);
// Issue the fourth request with the correct password and username.
TestCompletionCallback callback4;
« no previous file with comments | « net/http/http_log_util.cc ('k') | net/http/mock_allow_http_auth_preferences.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698