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

Unified Diff: net/http/http_auth_unittest.cc

Issue 10916272: Remove HttpAuth::Scheme enum in favor of a string. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 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_handler_ntlm.cc ('k') | net/http/http_proxy_client_socket_pool_spdy2_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_auth_unittest.cc
diff --git a/net/http/http_auth_unittest.cc b/net/http/http_auth_unittest.cc
index e70cb0da9ca9fc02abf2daa24b8f75ba26271896..4c264f2c52a595ce489e8e4b2ab5614c2516e6ee 100644
--- a/net/http/http_auth_unittest.cc
+++ b/net/http/http_auth_unittest.cc
@@ -49,7 +49,7 @@ HttpAuth::AuthorizationResult HandleChallengeResponse(
std::string* challenge_used) {
scoped_ptr<HttpAuthHandlerMock> mock_handler(
CreateMockHandler(connection_based));
- std::set<HttpAuth::Scheme> disabled_schemes;
+ std::set<std::string> disabled_schemes;
scoped_refptr<HttpResponseHeaders> headers(
HeadersFromResponseText(headers_text));
return HttpAuth::HandleChallengeResponse(
@@ -65,7 +65,7 @@ HttpAuth::AuthorizationResult HandleChallengeResponse(
TEST(HttpAuthTest, ChooseBestChallenge) {
static const struct {
const char* headers;
- HttpAuth::Scheme challenge_scheme;
+ const char* challenge_scheme;
const char* challenge_realm;
} tests[] = {
{
@@ -73,7 +73,7 @@ TEST(HttpAuthTest, ChooseBestChallenge) {
"Y: Digest realm=\"X\", nonce=\"aaaaaaaaaa\"\n"
"www-authenticate: Basic realm=\"BasicRealm\"\n",
- HttpAuth::AUTH_SCHEME_BASIC,
+ "basic",
"BasicRealm",
},
{
@@ -81,7 +81,7 @@ TEST(HttpAuthTest, ChooseBestChallenge) {
"Y: Digest realm=\"FooBar\", nonce=\"aaaaaaaaaa\"\n"
"www-authenticate: Fake realm=\"FooBar\"\n",
- HttpAuth::AUTH_SCHEME_MAX,
+ "",
"",
},
{
@@ -91,7 +91,7 @@ TEST(HttpAuthTest, ChooseBestChallenge) {
"www-authenticate: nonce=\"aaaaaaaaaa\"\n"
"www-authenticate: Digest realm=\"DigestRealm\", nonce=\"aaaaaaaaaa\"\n",
- HttpAuth::AUTH_SCHEME_DIGEST,
+ "digest",
"DigestRealm",
},
{
@@ -99,7 +99,7 @@ TEST(HttpAuthTest, ChooseBestChallenge) {
"Y: Digest realm=\"X\", nonce=\"aaaaaaaaaa\"\n"
"www-authenticate:\n",
- HttpAuth::AUTH_SCHEME_MAX,
+ "",
"",
},
{
@@ -111,16 +111,16 @@ TEST(HttpAuthTest, ChooseBestChallenge) {
// TODO(ahendrickson): This may be flaky on Linux and OSX as it
// relies on being able to load one of the known .so files
// for gssapi.
- HttpAuth::AUTH_SCHEME_NEGOTIATE,
+ "negotiate",
#else
// On systems that don't use Kerberos fall back to NTLM.
- HttpAuth::AUTH_SCHEME_NTLM,
+ "ntlm",
#endif // defined(USE_KERBEROS)
"",
}
};
GURL origin("http://www.example.com");
- std::set<HttpAuth::Scheme> disabled_schemes;
+ std::set<std::string> disabled_schemes;
MockAllowURLSecurityManager url_security_manager;
scoped_ptr<HostResolver> host_resolver(new MockHostResolver());
scoped_ptr<HttpAuthHandlerRegistryFactory> http_auth_handler_factory(
@@ -145,10 +145,10 @@ TEST(HttpAuthTest, ChooseBestChallenge) {
&handler);
if (handler.get()) {
- EXPECT_EQ(tests[i].challenge_scheme, handler->auth_scheme());
+ EXPECT_STREQ(tests[i].challenge_scheme, handler->auth_scheme().c_str());
EXPECT_STREQ(tests[i].challenge_realm, handler->realm().c_str());
} else {
- EXPECT_EQ(HttpAuth::AUTH_SCHEME_MAX, tests[i].challenge_scheme);
+ EXPECT_STREQ("", tests[i].challenge_scheme);
EXPECT_STREQ("", tests[i].challenge_realm);
}
}
« no previous file with comments | « net/http/http_auth_handler_ntlm.cc ('k') | net/http/http_proxy_client_socket_pool_spdy2_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698