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

Unified Diff: net/http/http_auth_handler_basic_unittest.cc

Issue 3360017: Fix multi-round authentication.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: SocketStream fix Created 10 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_basic.cc ('k') | net/http/http_auth_handler_digest.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_auth_handler_basic_unittest.cc
===================================================================
--- net/http/http_auth_handler_basic_unittest.cc (revision 59119)
+++ net/http/http_auth_handler_basic_unittest.cc (working copy)
@@ -66,6 +66,52 @@
OK,
"",
},
+
+ // Realm is valid.
+ {
+ "Basic realm=\"test_realm\"",
+ OK,
+ "test_realm",
+ },
+
+ // The parser ignores tokens which aren't known.
+ {
+ "Basic realm=\"test_realm\",unknown_token=foobar",
+ OK,
+ "test_realm",
+ },
+
+ // The parser skips over tokens which aren't known.
+ {
+ "Basic unknown_token=foobar,realm=\"test_realm\"",
+ OK,
+ "test_realm",
+ },
+
+#if 0
+ // TODO(cbentzel): It's unclear what the parser should do in these cases.
+ // It seems like this should either be treated as invalid,
+ // or the spaces should be used as a separator.
+ {
+ "Basic realm=\"test_realm\" unknown_token=foobar",
+ OK,
+ "test_realm",
+ },
+
+ // The parser skips over tokens which aren't known.
+ {
+ "Basic unknown_token=foobar realm=\"test_realm\"",
+ OK,
+ "test_realm",
+ },
+#endif
+
+ // The parser fails when the first token is not "Basic".
+ {
+ "Negotiate",
+ ERR_INVALID_RESPONSE,
+ ""
+ },
};
HttpAuthHandlerBasic::Factory factory;
GURL origin("http://www.example.com");
« no previous file with comments | « net/http/http_auth_handler_basic.cc ('k') | net/http/http_auth_handler_digest.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698