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

Unified Diff: net/http/http_auth_unittest.cc

Issue 1128043007: Support Kerberos on Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix cbentzel@'s nits Created 5 years, 5 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_unittest.cc
diff --git a/net/http/http_auth_unittest.cc b/net/http/http_auth_unittest.cc
index 52e829490da09990032da4468f72533bdf596c74..a81a409f06461acf07abd8cea5f0792bd84bf4b5 100644
--- a/net/http/http_auth_unittest.cc
+++ b/net/http/http_auth_unittest.cc
@@ -69,57 +69,56 @@ TEST(HttpAuthTest, ChooseBestChallenge) {
HttpAuth::Scheme challenge_scheme;
const char* challenge_realm;
} tests[] = {
- {
- // Basic is the only challenge type, pick it.
- "Y: Digest realm=\"X\", nonce=\"aaaaaaaaaa\"\n"
- "www-authenticate: Basic realm=\"BasicRealm\"\n",
-
- HttpAuth::AUTH_SCHEME_BASIC,
- "BasicRealm",
- },
- {
- // Fake is the only challenge type, but it is unsupported.
- "Y: Digest realm=\"FooBar\", nonce=\"aaaaaaaaaa\"\n"
- "www-authenticate: Fake realm=\"FooBar\"\n",
-
- HttpAuth::AUTH_SCHEME_MAX,
- "",
- },
- {
- // Pick Digest over Basic.
- "www-authenticate: Basic realm=\"FooBar\"\n"
- "www-authenticate: Fake realm=\"FooBar\"\n"
- "www-authenticate: nonce=\"aaaaaaaaaa\"\n"
- "www-authenticate: Digest realm=\"DigestRealm\", nonce=\"aaaaaaaaaa\"\n",
-
- HttpAuth::AUTH_SCHEME_DIGEST,
- "DigestRealm",
- },
- {
- // Handle an empty header correctly.
- "Y: Digest realm=\"X\", nonce=\"aaaaaaaaaa\"\n"
- "www-authenticate:\n",
-
- HttpAuth::AUTH_SCHEME_MAX,
- "",
- },
- {
- "WWW-Authenticate: Negotiate\n"
- "WWW-Authenticate: NTLM\n",
-
-#if defined(USE_KERBEROS)
- // Choose Negotiate over NTLM on all platforms.
- // 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,
+ {
+ // Basic is the only challenge type, pick it.
+ "Y: Digest realm=\"X\", nonce=\"aaaaaaaaaa\"\n"
+ "www-authenticate: Basic realm=\"BasicRealm\"\n",
+
+ HttpAuth::AUTH_SCHEME_BASIC,
+ "BasicRealm",
+ },
+ {
+ // Fake is the only challenge type, but it is unsupported.
+ "Y: Digest realm=\"FooBar\", nonce=\"aaaaaaaaaa\"\n"
+ "www-authenticate: Fake realm=\"FooBar\"\n",
+
+ HttpAuth::AUTH_SCHEME_MAX,
+ "",
+ },
+ {
+ // Pick Digest over Basic.
+ "www-authenticate: Basic realm=\"FooBar\"\n"
+ "www-authenticate: Fake realm=\"FooBar\"\n"
+ "www-authenticate: nonce=\"aaaaaaaaaa\"\n"
+ "www-authenticate: Digest realm=\"DigestRealm\", nonce=\"aaaaaaaaaa\"\n",
+
+ HttpAuth::AUTH_SCHEME_DIGEST,
+ "DigestRealm",
+ },
+ {
+ // Handle an empty header correctly.
+ "Y: Digest realm=\"X\", nonce=\"aaaaaaaaaa\"\n"
+ "www-authenticate:\n",
+
+ HttpAuth::AUTH_SCHEME_MAX,
+ "",
+ },
+ {
+ "WWW-Authenticate: Negotiate\n"
+ "WWW-Authenticate: NTLM\n",
+
+#if defined(USE_KERBEROS) && !defined(OS_ANDROID)
+ // Choose Negotiate over NTLM on all platforms.
+ // 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,
#else
- // On systems that don't use Kerberos fall back to NTLM.
- HttpAuth::AUTH_SCHEME_NTLM,
+ // On systems that don't use Kerberos fall back to NTLM.
+ HttpAuth::AUTH_SCHEME_NTLM,
#endif // defined(USE_KERBEROS)
- "",
- }
- };
+ "",
+ }};
GURL origin("http://www.example.com");
std::set<HttpAuth::Scheme> disabled_schemes;
MockAllowURLSecurityManager url_security_manager;

Powered by Google App Engine
This is Rietveld 408576698