OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "net/http/http_proxy_client_socket_pool.h" | 5 #include "net/http/http_proxy_client_socket_pool.h" |
6 | 6 |
7 #include "base/callback.h" | 7 #include "base/callback.h" |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/time.h" | 9 #include "base/time.h" |
10 #include "net/base/auth.h" | 10 #include "net/base/auth.h" |
(...skipping 625 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
636 const HttpResponseInfo& tunnel_info = handle.ssl_error_response_info(); | 636 const HttpResponseInfo& tunnel_info = handle.ssl_error_response_info(); |
637 EXPECT_EQ(tunnel_info.headers->response_code(), 407); | 637 EXPECT_EQ(tunnel_info.headers->response_code(), 407); |
638 | 638 |
639 params->http_proxy_params()->auth_controller()->ResetAuth(std::wstring(), | 639 params->http_proxy_params()->auth_controller()->ResetAuth(std::wstring(), |
640 std::wstring()); | 640 std::wstring()); |
641 rv = handle.Init("a", params, MEDIUM, &callback, pool_, BoundNetLog()); | 641 rv = handle.Init("a", params, MEDIUM, &callback, pool_, BoundNetLog()); |
642 EXPECT_EQ(ERR_IO_PENDING, rv); | 642 EXPECT_EQ(ERR_IO_PENDING, rv); |
643 EXPECT_FALSE(handle.is_initialized()); | 643 EXPECT_FALSE(handle.is_initialized()); |
644 EXPECT_FALSE(handle.socket()); | 644 EXPECT_FALSE(handle.socket()); |
645 | 645 |
| 646 // Test that http://crbug.com/49325 doesn't regress. |
| 647 EXPECT_EQ(handle.GetLoadState(), LOAD_STATE_ESTABLISHING_PROXY_TUNNEL); |
| 648 |
646 EXPECT_EQ(OK, callback.WaitForResult()); | 649 EXPECT_EQ(OK, callback.WaitForResult()); |
647 EXPECT_TRUE(handle.is_initialized()); | 650 EXPECT_TRUE(handle.is_initialized()); |
648 EXPECT_TRUE(handle.socket()); | 651 EXPECT_TRUE(handle.socket()); |
649 } | 652 } |
650 | 653 |
651 TEST_F(SSLClientSocketPoolTest, DoProxyAuthNoKeepAlive) { | 654 TEST_F(SSLClientSocketPoolTest, DoProxyAuthNoKeepAlive) { |
652 MockWrite writes1[] = { | 655 MockWrite writes1[] = { |
653 MockWrite("CONNECT host:80 HTTP/1.1\r\n" | 656 MockWrite("CONNECT host:80 HTTP/1.1\r\n" |
654 "Host: host\r\n" | 657 "Host: host\r\n" |
655 "Proxy-Connection: keep-alive\r\n\r\n"), | 658 "Proxy-Connection: keep-alive\r\n\r\n"), |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
711 EXPECT_EQ(OK, callback.WaitForResult()); | 714 EXPECT_EQ(OK, callback.WaitForResult()); |
712 EXPECT_TRUE(handle.is_initialized()); | 715 EXPECT_TRUE(handle.is_initialized()); |
713 EXPECT_TRUE(handle.socket()); | 716 EXPECT_TRUE(handle.socket()); |
714 } | 717 } |
715 | 718 |
716 // It would be nice to also test the timeouts in SSLClientSocketPool. | 719 // It would be nice to also test the timeouts in SSLClientSocketPool. |
717 | 720 |
718 } // namespace | 721 } // namespace |
719 | 722 |
720 } // namespace net | 723 } // namespace net |
OLD | NEW |