| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <string> | 5 #include <string> |
| 6 #include <vector> | 6 #include <vector> |
| 7 | 7 |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/bind_helpers.h" | 9 #include "base/bind_helpers.h" |
| 10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
| (...skipping 4769 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4780 GetParam(), | 4780 GetParam(), |
| 4781 ProxyService::CreateFixedFromPacResult("PROXY myproxy:70"))); | 4781 ProxyService::CreateFixedFromPacResult("PROXY myproxy:70"))); |
| 4782 helper.SetSession(make_scoped_refptr( | 4782 helper.SetSession(make_scoped_refptr( |
| 4783 SpdySessionDependencies::SpdyCreateSession(helper.session_deps().get()))); | 4783 SpdySessionDependencies::SpdyCreateSession(helper.session_deps().get()))); |
| 4784 helper.RunPreTestSetup(); | 4784 helper.RunPreTestSetup(); |
| 4785 HttpNetworkTransaction* trans = helper.trans(); | 4785 HttpNetworkTransaction* trans = helper.trans(); |
| 4786 | 4786 |
| 4787 const char kConnect443[] = {"CONNECT www.google.com:443 HTTP/1.1\r\n" | 4787 const char kConnect443[] = {"CONNECT www.google.com:443 HTTP/1.1\r\n" |
| 4788 "Host: www.google.com\r\n" | 4788 "Host: www.google.com\r\n" |
| 4789 "Proxy-Connection: keep-alive\r\n\r\n"}; | 4789 "Proxy-Connection: keep-alive\r\n\r\n"}; |
| 4790 const char kConnect80[] = {"CONNECT www.google.com:80 HTTP/1.1\r\n" | 4790 const char kConnect80[] = { |
| 4791 "Host: www.google.com\r\n" | 4791 "CONNECT www.google.com:80 HTTP/1.1\r\n" |
| 4792 "Proxy-Connection: keep-alive\r\n\r\n"}; | 4792 "Host: www.google.com:80\r\n" |
| 4793 "Proxy-Connection: keep-alive\r\n\r\n"}; |
| 4793 const char kHTTP200[] = {"HTTP/1.1 200 OK\r\n\r\n"}; | 4794 const char kHTTP200[] = {"HTTP/1.1 200 OK\r\n\r\n"}; |
| 4794 scoped_ptr<SpdyFrame> req( | 4795 scoped_ptr<SpdyFrame> req( |
| 4795 spdy_util_.ConstructSpdyGet(NULL, 0, false, 1, LOWEST, true)); | 4796 spdy_util_.ConstructSpdyGet(NULL, 0, false, 1, LOWEST, true)); |
| 4796 scoped_ptr<SpdyFrame> resp(spdy_util_.ConstructSpdyGetSynReply(NULL, 0, 1)); | 4797 scoped_ptr<SpdyFrame> resp(spdy_util_.ConstructSpdyGetSynReply(NULL, 0, 1)); |
| 4797 scoped_ptr<SpdyFrame> body(spdy_util_.ConstructSpdyBodyFrame(1, true)); | 4798 scoped_ptr<SpdyFrame> body(spdy_util_.ConstructSpdyBodyFrame(1, true)); |
| 4798 | 4799 |
| 4799 MockWrite writes_SPDYNPN[] = { | 4800 MockWrite writes_SPDYNPN[] = { |
| 4800 MockWrite(SYNCHRONOUS, kConnect443, arraysize(kConnect443) - 1, 0), | 4801 MockWrite(SYNCHRONOUS, kConnect443, arraysize(kConnect443) - 1, 0), |
| 4801 CreateMockWrite(*req, 2), | 4802 CreateMockWrite(*req, 2), |
| 4802 }; | 4803 }; |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4941 SpdySessionKey session_pool_key_proxy( | 4942 SpdySessionKey session_pool_key_proxy( |
| 4942 host_port_pair, | 4943 host_port_pair, |
| 4943 ProxyServer::FromURI("www.foo.com", ProxyServer::SCHEME_HTTP), | 4944 ProxyServer::FromURI("www.foo.com", ProxyServer::SCHEME_HTTP), |
| 4944 PRIVACY_MODE_DISABLED); | 4945 PRIVACY_MODE_DISABLED); |
| 4945 EXPECT_FALSE(HasSpdySession(spdy_session_pool, session_pool_key_proxy)); | 4946 EXPECT_FALSE(HasSpdySession(spdy_session_pool, session_pool_key_proxy)); |
| 4946 | 4947 |
| 4947 // Set up data for the proxy connection. | 4948 // Set up data for the proxy connection. |
| 4948 const char kConnect443[] = {"CONNECT www.google.com:443 HTTP/1.1\r\n" | 4949 const char kConnect443[] = {"CONNECT www.google.com:443 HTTP/1.1\r\n" |
| 4949 "Host: www.google.com\r\n" | 4950 "Host: www.google.com\r\n" |
| 4950 "Proxy-Connection: keep-alive\r\n\r\n"}; | 4951 "Proxy-Connection: keep-alive\r\n\r\n"}; |
| 4951 const char kConnect80[] = {"CONNECT www.google.com:80 HTTP/1.1\r\n" | 4952 const char kConnect80[] = { |
| 4952 "Host: www.google.com\r\n" | 4953 "CONNECT www.google.com:80 HTTP/1.1\r\n" |
| 4953 "Proxy-Connection: keep-alive\r\n\r\n"}; | 4954 "Host: www.google.com:80\r\n" |
| 4955 "Proxy-Connection: keep-alive\r\n\r\n"}; |
| 4954 const char kHTTP200[] = {"HTTP/1.1 200 OK\r\n\r\n"}; | 4956 const char kHTTP200[] = {"HTTP/1.1 200 OK\r\n\r\n"}; |
| 4955 scoped_ptr<SpdyFrame> req2(spdy_util_.ConstructSpdyGet( | 4957 scoped_ptr<SpdyFrame> req2(spdy_util_.ConstructSpdyGet( |
| 4956 "http://www.google.com/foo.dat", false, 1, LOWEST)); | 4958 "http://www.google.com/foo.dat", false, 1, LOWEST)); |
| 4957 scoped_ptr<SpdyFrame> resp2(spdy_util_.ConstructSpdyGetSynReply(NULL, 0, 1)); | 4959 scoped_ptr<SpdyFrame> resp2(spdy_util_.ConstructSpdyGetSynReply(NULL, 0, 1)); |
| 4958 scoped_ptr<SpdyFrame> body2(spdy_util_.ConstructSpdyBodyFrame(1, true)); | 4960 scoped_ptr<SpdyFrame> body2(spdy_util_.ConstructSpdyBodyFrame(1, true)); |
| 4959 | 4961 |
| 4960 MockWrite writes_SPDYNPN[] = { | 4962 MockWrite writes_SPDYNPN[] = { |
| 4961 MockWrite(SYNCHRONOUS, kConnect443, arraysize(kConnect443) - 1, 0), | 4963 MockWrite(SYNCHRONOUS, kConnect443, arraysize(kConnect443) - 1, 0), |
| 4962 CreateMockWrite(*req2, 2), | 4964 CreateMockWrite(*req2, 2), |
| 4963 }; | 4965 }; |
| (...skipping 1848 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6812 TEST_P(SpdyNetworkTransactionTLSUsageCheckTest, TLSCipherSuiteSucky) { | 6814 TEST_P(SpdyNetworkTransactionTLSUsageCheckTest, TLSCipherSuiteSucky) { |
| 6813 scoped_ptr<SSLSocketDataProvider> ssl_provider( | 6815 scoped_ptr<SSLSocketDataProvider> ssl_provider( |
| 6814 new SSLSocketDataProvider(ASYNC, OK)); | 6816 new SSLSocketDataProvider(ASYNC, OK)); |
| 6815 // Set to TLS_RSA_WITH_NULL_MD5 | 6817 // Set to TLS_RSA_WITH_NULL_MD5 |
| 6816 SSLConnectionStatusSetCipherSuite(0x1, &ssl_provider->connection_status); | 6818 SSLConnectionStatusSetCipherSuite(0x1, &ssl_provider->connection_status); |
| 6817 | 6819 |
| 6818 RunTLSUsageCheckTest(ssl_provider.Pass()); | 6820 RunTLSUsageCheckTest(ssl_provider.Pass()); |
| 6819 } | 6821 } |
| 6820 | 6822 |
| 6821 } // namespace net | 6823 } // namespace net |
| OLD | NEW |