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

Unified Diff: net/http/http_proxy_client_socket_pool_unittest.cc

Issue 8609006: Revert 110879 - Allow chrome to handle 407 auth challenges to CONNECT requests (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 1 month 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_proxy_client_socket.cc ('k') | net/http/http_proxy_utils.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_proxy_client_socket_pool_unittest.cc
===================================================================
--- net/http/http_proxy_client_socket_pool_unittest.cc (revision 110879)
+++ net/http/http_proxy_client_socket_pool_unittest.cc (working copy)
@@ -257,22 +257,9 @@
CreateMockWrite(*req, 0, true),
CreateMockWrite(*rst, 2, true),
};
- static const char* const kAuthChallenge[] = {
- "status", "407 Proxy Authentication Required",
- "version", "HTTP/1.1",
- "proxy-authenticate", "Basic realm=\"MyRealm1\"",
- };
-
scoped_ptr<spdy::SpdyFrame> resp(
- ConstructSpdyControlFrame(NULL,
- 0,
- false,
- 1,
- LOWEST,
- spdy::SYN_REPLY,
- spdy::CONTROL_FLAG_NONE,
- kAuthChallenge,
- arraysize(kAuthChallenge)));
+ ConstructSpdySynReplyError(
+ "407 Proxy Authentication Required", NULL, 0, 1));
MockRead spdy_reads[] = {
CreateMockWrite(*resp, 1, true),
MockRead(true, 0, 3)
@@ -289,16 +276,21 @@
EXPECT_FALSE(handle_.is_initialized());
EXPECT_FALSE(handle_.socket());
- data_->RunFor(GetParam() == SPDY ? 2 : 4);
+ data_->RunFor(4);
rv = callback_.WaitForResult();
- EXPECT_EQ(ERR_PROXY_AUTH_REQUESTED, rv);
- EXPECT_TRUE(handle_.is_initialized());
- ASSERT_TRUE(handle_.socket());
if (GetParam() != SPDY) {
+ EXPECT_EQ(ERR_PROXY_AUTH_REQUESTED, rv);
+ EXPECT_TRUE(handle_.is_initialized());
+ ASSERT_TRUE(handle_.socket());
HttpProxyClientSocket* tunnel_socket =
static_cast<HttpProxyClientSocket*>(handle_.socket());
EXPECT_FALSE(tunnel_socket->IsConnected());
EXPECT_FALSE(tunnel_socket->using_spdy());
+ } else {
+ // Proxy auth is not really implemented for SPDY yet
+ EXPECT_EQ(ERR_TUNNEL_CONNECTION_FAILED, rv);
+ EXPECT_FALSE(handle_.is_initialized());
+ EXPECT_FALSE(handle_.socket());
}
}
« no previous file with comments | « net/http/http_proxy_client_socket.cc ('k') | net/http/http_proxy_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698