| 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 <utility> | 6 #include <utility> |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| 11 #include "base/files/file_util.h" | 11 #include "base/files/file_util.h" |
| 12 #include "base/files/scoped_temp_dir.h" | 12 #include "base/files/scoped_temp_dir.h" |
| 13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 14 #include "base/run_loop.h" | 14 #include "base/run_loop.h" |
| 15 #include "base/strings/string_piece.h" | 15 #include "base/strings/string_piece.h" |
| 16 #include "base/test/test_file_util.h" | 16 #include "base/test/test_file_util.h" |
| 17 #include "base/thread_task_runner_handle.h" | 17 #include "base/thread_task_runner_handle.h" |
| 18 #include "net/base/auth.h" | 18 #include "net/base/auth.h" |
| 19 #include "net/base/chunked_upload_data_stream.h" | 19 #include "net/base/chunked_upload_data_stream.h" |
| 20 #include "net/base/elements_upload_data_stream.h" | 20 #include "net/base/elements_upload_data_stream.h" |
| 21 #include "net/base/proxy_delegate.h" |
| 21 #include "net/base/request_priority.h" | 22 #include "net/base/request_priority.h" |
| 22 #include "net/base/test_data_directory.h" | 23 #include "net/base/test_data_directory.h" |
| 24 #include "net/base/test_proxy_delegate.h" |
| 23 #include "net/base/upload_bytes_element_reader.h" | 25 #include "net/base/upload_bytes_element_reader.h" |
| 24 #include "net/base/upload_file_element_reader.h" | 26 #include "net/base/upload_file_element_reader.h" |
| 25 #include "net/http/http_auth_scheme.h" | 27 #include "net/http/http_auth_scheme.h" |
| 26 #include "net/http/http_network_session_peer.h" | 28 #include "net/http/http_network_session_peer.h" |
| 27 #include "net/http/http_network_transaction.h" | 29 #include "net/http/http_network_transaction.h" |
| 28 #include "net/http/http_server_properties.h" | 30 #include "net/http/http_server_properties.h" |
| 29 #include "net/http/http_transaction_test_util.h" | 31 #include "net/http/http_transaction_test_util.h" |
| 30 #include "net/log/test_net_log.h" | 32 #include "net/log/test_net_log.h" |
| 31 #include "net/log/test_net_log_entry.h" | 33 #include "net/log/test_net_log_entry.h" |
| 32 #include "net/log/test_net_log_util.h" | 34 #include "net/log/test_net_log_util.h" |
| 35 #include "net/proxy/proxy_server.h" |
| 33 #include "net/socket/client_socket_pool_base.h" | 36 #include "net/socket/client_socket_pool_base.h" |
| 34 #include "net/socket/next_proto.h" | 37 #include "net/socket/next_proto.h" |
| 35 #include "net/spdy/buffered_spdy_framer.h" | 38 #include "net/spdy/buffered_spdy_framer.h" |
| 36 #include "net/spdy/spdy_http_stream.h" | 39 #include "net/spdy/spdy_http_stream.h" |
| 37 #include "net/spdy/spdy_http_utils.h" | 40 #include "net/spdy/spdy_http_utils.h" |
| 38 #include "net/spdy/spdy_session.h" | 41 #include "net/spdy/spdy_session.h" |
| 39 #include "net/spdy/spdy_session_pool.h" | 42 #include "net/spdy/spdy_session_pool.h" |
| 40 #include "net/spdy/spdy_test_util_common.h" | 43 #include "net/spdy/spdy_test_util_common.h" |
| 41 #include "net/spdy/spdy_test_utils.h" | 44 #include "net/spdy/spdy_test_utils.h" |
| 42 #include "net/ssl/ssl_connection_status_flags.h" | 45 #include "net/ssl/ssl_connection_status_flags.h" |
| (...skipping 5424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5467 | 5470 |
| 5468 HttpRequestInfo request; | 5471 HttpRequestInfo request; |
| 5469 request.method = "GET"; | 5472 request.method = "GET"; |
| 5470 request.url = GURL(url_to_fetch); | 5473 request.url = GURL(url_to_fetch); |
| 5471 request.load_flags = 0; | 5474 request.load_flags = 0; |
| 5472 | 5475 |
| 5473 // Enable cross-origin push. Since we are not using a proxy, this should | 5476 // Enable cross-origin push. Since we are not using a proxy, this should |
| 5474 // not actually enable cross-origin SPDY push. | 5477 // not actually enable cross-origin SPDY push. |
| 5475 scoped_ptr<SpdySessionDependencies> session_deps( | 5478 scoped_ptr<SpdySessionDependencies> session_deps( |
| 5476 CreateSpdySessionDependencies(GetParam())); | 5479 CreateSpdySessionDependencies(GetParam())); |
| 5477 session_deps->trusted_spdy_proxy = "123.45.67.89:8080"; | 5480 scoped_ptr<TestProxyDelegate> proxy_delegate(new TestProxyDelegate()); |
| 5481 proxy_delegate->set_trusted_spdy_proxy(net::ProxyServer::FromURI( |
| 5482 "https://123.45.67.89:443", net::ProxyServer::SCHEME_HTTP)); |
| 5483 session_deps->proxy_delegate.reset(proxy_delegate.release()); |
| 5478 NormalSpdyTransactionHelper helper(request, DEFAULT_PRIORITY, BoundNetLog(), | 5484 NormalSpdyTransactionHelper helper(request, DEFAULT_PRIORITY, BoundNetLog(), |
| 5479 GetParam(), std::move(session_deps)); | 5485 GetParam(), std::move(session_deps)); |
| 5480 helper.RunPreTestSetup(); | 5486 helper.RunPreTestSetup(); |
| 5481 helper.AddData(&data); | 5487 helper.AddData(&data); |
| 5482 | 5488 |
| 5483 HttpNetworkTransaction* trans = helper.trans(); | 5489 HttpNetworkTransaction* trans = helper.trans(); |
| 5484 | 5490 |
| 5485 // Start the transaction with basic parameters. | 5491 // Start the transaction with basic parameters. |
| 5486 TestCompletionCallback callback; | 5492 TestCompletionCallback callback; |
| 5487 | 5493 |
| (...skipping 1078 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6566 TEST_P(SpdyNetworkTransactionTLSUsageCheckTest, TLSCipherSuiteSucky) { | 6572 TEST_P(SpdyNetworkTransactionTLSUsageCheckTest, TLSCipherSuiteSucky) { |
| 6567 scoped_ptr<SSLSocketDataProvider> ssl_provider( | 6573 scoped_ptr<SSLSocketDataProvider> ssl_provider( |
| 6568 new SSLSocketDataProvider(ASYNC, OK)); | 6574 new SSLSocketDataProvider(ASYNC, OK)); |
| 6569 // Set to TLS_RSA_WITH_NULL_MD5 | 6575 // Set to TLS_RSA_WITH_NULL_MD5 |
| 6570 SSLConnectionStatusSetCipherSuite(0x1, &ssl_provider->connection_status); | 6576 SSLConnectionStatusSetCipherSuite(0x1, &ssl_provider->connection_status); |
| 6571 | 6577 |
| 6572 RunTLSUsageCheckTest(std::move(ssl_provider)); | 6578 RunTLSUsageCheckTest(std::move(ssl_provider)); |
| 6573 } | 6579 } |
| 6574 | 6580 |
| 6575 } // namespace net | 6581 } // namespace net |
| OLD | NEW |