Index: net/http/http_proxy_client_socket_pool_unittest.cc |
diff --git a/net/http/http_proxy_client_socket_pool_unittest.cc b/net/http/http_proxy_client_socket_pool_unittest.cc |
index a40c9da8138fcb954082bee32dfe719488963c6d..808305240ad51fb3feeb5c69be8100e1ac97b627 100644 |
--- a/net/http/http_proxy_client_socket_pool_unittest.cc |
+++ b/net/http/http_proxy_client_socket_pool_unittest.cc |
@@ -564,6 +564,37 @@ TEST_P(HttpProxyClientSocketPoolTest, TunnelUnexpectedClose) { |
EXPECT_FALSE(handle_.socket()); |
} |
+TEST_P(HttpProxyClientSocketPoolTest, Tunnel1xxResponse) { |
+ // Tests that 1xx responses are rejected for a CONNECT request. |
+ if (GetParam().proxy_type == SPDY) { |
+ // SPDY doesn't have 1xx responses. |
+ return; |
+ } |
+ |
+ MockWrite writes[] = { |
+ MockWrite(ASYNC, 0, |
+ "CONNECT www.google.com:443 HTTP/1.1\r\n" |
+ "Host: www.google.com\r\n" |
+ "Proxy-Connection: keep-alive\r\n\r\n"), |
+ }; |
+ MockRead reads[] = { |
+ MockRead(ASYNC, 1, "HTTP/1.1 100 Continue\r\n\r\n"), |
+ MockRead(ASYNC, 2, "HTTP/1.1 200 Connection Established\r\n\r\n"), |
+ }; |
+ |
+ Initialize(reads, arraysize(reads), writes, arraysize(writes), |
+ NULL, 0, NULL, 0); |
+ |
+ int rv = handle_.Init("a", CreateTunnelParams(), LOW, callback_.callback(), |
+ &pool_, BoundNetLog()); |
+ EXPECT_EQ(ERR_IO_PENDING, rv); |
+ EXPECT_FALSE(handle_.is_initialized()); |
+ EXPECT_FALSE(handle_.socket()); |
+ |
+ data_->RunFor(2); |
+ EXPECT_EQ(ERR_TUNNEL_CONNECTION_FAILED, callback_.WaitForResult()); |
+} |
+ |
TEST_P(HttpProxyClientSocketPoolTest, TunnelSetupError) { |
MockWrite writes[] = { |
MockWrite(ASYNC, 0, |