OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_network_transaction.h" | 5 #include "net/http/http_network_transaction.h" |
6 | 6 |
7 #include <math.h> // ceil | 7 #include <math.h> // ceil |
8 #include <stdarg.h> | 8 #include <stdarg.h> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 9732 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9743 UseAlternateProtocolForTunneledNpnSpdy) { | 9743 UseAlternateProtocolForTunneledNpnSpdy) { |
9744 session_deps_.use_alternate_protocols = true; | 9744 session_deps_.use_alternate_protocols = true; |
9745 session_deps_.next_protos = SpdyNextProtos(); | 9745 session_deps_.next_protos = SpdyNextProtos(); |
9746 | 9746 |
9747 ProxyConfig proxy_config; | 9747 ProxyConfig proxy_config; |
9748 proxy_config.set_auto_detect(true); | 9748 proxy_config.set_auto_detect(true); |
9749 proxy_config.set_pac_url(GURL("http://fooproxyurl")); | 9749 proxy_config.set_pac_url(GURL("http://fooproxyurl")); |
9750 | 9750 |
9751 CapturingProxyResolver capturing_proxy_resolver; | 9751 CapturingProxyResolver capturing_proxy_resolver; |
9752 session_deps_.proxy_service.reset(new ProxyService( | 9752 session_deps_.proxy_service.reset(new ProxyService( |
9753 new ProxyConfigServiceFixed(proxy_config), | 9753 make_scoped_ptr(new ProxyConfigServiceFixed(proxy_config)), |
9754 make_scoped_ptr( | 9754 make_scoped_ptr( |
9755 new CapturingProxyResolverFactory(&capturing_proxy_resolver)), | 9755 new CapturingProxyResolverFactory(&capturing_proxy_resolver)), |
9756 NULL)); | 9756 NULL)); |
9757 TestNetLog net_log; | 9757 TestNetLog net_log; |
9758 session_deps_.net_log = &net_log; | 9758 session_deps_.net_log = &net_log; |
9759 | 9759 |
9760 HttpRequestInfo request; | 9760 HttpRequestInfo request; |
9761 request.method = "GET"; | 9761 request.method = "GET"; |
9762 request.url = GURL("http://www.example.org/"); | 9762 request.url = GURL("http://www.example.org/"); |
9763 request.load_flags = 0; | 9763 request.load_flags = 0; |
(...skipping 2794 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
12558 new DeterministicSocketData(reads2, arraysize(reads2), | 12558 new DeterministicSocketData(reads2, arraysize(reads2), |
12559 writes2, arraysize(writes2))); | 12559 writes2, arraysize(writes2))); |
12560 MockConnect connect_data2(ASYNC, OK); | 12560 MockConnect connect_data2(ASYNC, OK); |
12561 data2->set_connect_data(connect_data2); | 12561 data2->set_connect_data(connect_data2); |
12562 | 12562 |
12563 // Set up a proxy config that sends HTTP requests to a proxy, and | 12563 // Set up a proxy config that sends HTTP requests to a proxy, and |
12564 // all others direct. | 12564 // all others direct. |
12565 ProxyConfig proxy_config; | 12565 ProxyConfig proxy_config; |
12566 proxy_config.proxy_rules().ParseFromString("http=https://proxy:443"); | 12566 proxy_config.proxy_rules().ParseFromString("http=https://proxy:443"); |
12567 session_deps_.proxy_service.reset(new ProxyService( | 12567 session_deps_.proxy_service.reset(new ProxyService( |
12568 new ProxyConfigServiceFixed(proxy_config), nullptr, NULL)); | 12568 make_scoped_ptr(new ProxyConfigServiceFixed(proxy_config)), nullptr, |
| 12569 NULL)); |
12569 | 12570 |
12570 SSLSocketDataProvider ssl1(ASYNC, OK); // to the proxy | 12571 SSLSocketDataProvider ssl1(ASYNC, OK); // to the proxy |
12571 ssl1.SetNextProto(GetParam()); | 12572 ssl1.SetNextProto(GetParam()); |
12572 // Load a valid cert. Note, that this does not need to | 12573 // Load a valid cert. Note, that this does not need to |
12573 // be valid for proxy because the MockSSLClientSocket does | 12574 // be valid for proxy because the MockSSLClientSocket does |
12574 // not actually verify it. But SpdySession will use this | 12575 // not actually verify it. But SpdySession will use this |
12575 // to see if it is valid for the new origin | 12576 // to see if it is valid for the new origin |
12576 ssl1.cert = ImportCertFromFile(GetTestCertsDirectory(), "ok_cert.pem"); | 12577 ssl1.cert = ImportCertFromFile(GetTestCertsDirectory(), "ok_cert.pem"); |
12577 ASSERT_TRUE(ssl1.cert.get()); | 12578 ASSERT_TRUE(ssl1.cert.get()); |
12578 session_deps_.deterministic_socket_factory->AddSSLSocketDataProvider(&ssl1); | 12579 session_deps_.deterministic_socket_factory->AddSSLSocketDataProvider(&ssl1); |
(...skipping 1812 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
14391 ASSERT_TRUE(response); | 14392 ASSERT_TRUE(response); |
14392 ASSERT_TRUE(response->headers.get()); | 14393 ASSERT_TRUE(response->headers.get()); |
14393 | 14394 |
14394 EXPECT_EQ(101, response->headers->response_code()); | 14395 EXPECT_EQ(101, response->headers->response_code()); |
14395 | 14396 |
14396 trans.reset(); | 14397 trans.reset(); |
14397 session->CloseAllConnections(); | 14398 session->CloseAllConnections(); |
14398 } | 14399 } |
14399 | 14400 |
14400 } // namespace net | 14401 } // namespace net |
OLD | NEW |