summaryrefslogtreecommitdiffstats
path: root/net/http/http_auth_handler_digest_unittest.cc
diff options
context:
space:
mode:
authorbashi@chromium.org <bashi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-09-08 17:37:24 +0000
committerbashi@chromium.org <bashi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-09-08 17:37:24 +0000
commitd46ca7306bacb12ed78d1a31090bd1a9fc3717f7 (patch)
tree39e0651137ca497a0f16ebb476cce2e132ae5f6b /net/http/http_auth_handler_digest_unittest.cc
parent0ba5ac7e87bcb17f65bac68d19e2016b6c053131 (diff)
downloadchromium_src-d46ca7306bacb12ed78d1a31090bd1a9fc3717f7.zip
chromium_src-d46ca7306bacb12ed78d1a31090bd1a9fc3717f7.tar.gz
chromium_src-d46ca7306bacb12ed78d1a31090bd1a9fc3717f7.tar.bz2
Use HttpAuthController in SocketStream
We need to share http auth cache with http stack because WebSocket is a subresource and chromium won't show the login dialog for subresource loading. Use HttpAuthController and pass the common http auth cache to it to solve the issue. BUG=47069 TEST=net_unittests Review URL: https://chromiumcodereview.appspot.com/10854139 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@155582 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http/http_auth_handler_digest_unittest.cc')
-rw-r--r--net/http/http_auth_handler_digest_unittest.cc28
1 files changed, 28 insertions, 0 deletions
diff --git a/net/http/http_auth_handler_digest_unittest.cc b/net/http/http_auth_handler_digest_unittest.cc
index c5549e7..55ef565 100644
--- a/net/http/http_auth_handler_digest_unittest.cc
+++ b/net/http/http_auth_handler_digest_unittest.cc
@@ -632,6 +632,34 @@ TEST(HttpAuthHandlerDigest, RespondToProxyChallengeHttps) {
auth_token);
}
+TEST(HttpAuthHandlerDigest, RespondToProxyChallengeWs) {
+ std::string auth_token;
+ EXPECT_TRUE(RespondToChallenge(
+ HttpAuth::AUTH_PROXY,
+ "http://proxy.intranet.corp.com:3128",
+ "ws://www.example.com/echo",
+ kSimpleChallenge,
+ &auth_token));
+ EXPECT_EQ("Digest username=\"foo\", realm=\"Oblivion\", "
+ "nonce=\"nonce-value\", uri=\"www.example.com:80\", "
+ "response=\"aa1df184f68d5b6ab9d9aa4f88e41b4c\"",
+ auth_token);
+}
+
+TEST(HttpAuthHandlerDigest, RespondToProxyChallengeWss) {
+ std::string auth_token;
+ EXPECT_TRUE(RespondToChallenge(
+ HttpAuth::AUTH_PROXY,
+ "http://proxy.intranet.corp.com:3128",
+ "wss://www.example.com/echo",
+ kSimpleChallenge,
+ &auth_token));
+ EXPECT_EQ("Digest username=\"foo\", realm=\"Oblivion\", "
+ "nonce=\"nonce-value\", uri=\"www.example.com:443\", "
+ "response=\"3270da8467afbe9ddf2334a48d46e9b9\"",
+ auth_token);
+}
+
TEST(HttpAuthHandlerDigest, RespondToChallengeAuthQop) {
std::string auth_token;
EXPECT_TRUE(RespondToChallenge(