| 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/memory/weak_ptr.h" |
| 14 #include "base/run_loop.h" | 15 #include "base/run_loop.h" |
| 15 #include "base/strings/string_piece.h" | 16 #include "base/strings/string_piece.h" |
| 16 #include "base/test/test_file_util.h" | 17 #include "base/test/test_file_util.h" |
| 17 #include "base/thread_task_runner_handle.h" | 18 #include "base/thread_task_runner_handle.h" |
| 18 #include "net/base/auth.h" | 19 #include "net/base/auth.h" |
| 19 #include "net/base/chunked_upload_data_stream.h" | 20 #include "net/base/chunked_upload_data_stream.h" |
| 21 #include "net/base/default_trusted_spdy_proxy_provider.h" |
| 20 #include "net/base/elements_upload_data_stream.h" | 22 #include "net/base/elements_upload_data_stream.h" |
| 21 #include "net/base/request_priority.h" | 23 #include "net/base/request_priority.h" |
| 22 #include "net/base/test_data_directory.h" | 24 #include "net/base/test_data_directory.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 5446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5489 | 5492 |
| 5490 HttpRequestInfo request; | 5493 HttpRequestInfo request; |
| 5491 request.method = "GET"; | 5494 request.method = "GET"; |
| 5492 request.url = GURL(url_to_fetch); | 5495 request.url = GURL(url_to_fetch); |
| 5493 request.load_flags = 0; | 5496 request.load_flags = 0; |
| 5494 | 5497 |
| 5495 // Enable cross-origin push. Since we are not using a proxy, this should | 5498 // Enable cross-origin push. Since we are not using a proxy, this should |
| 5496 // not actually enable cross-origin SPDY push. | 5499 // not actually enable cross-origin SPDY push. |
| 5497 scoped_ptr<SpdySessionDependencies> session_deps( | 5500 scoped_ptr<SpdySessionDependencies> session_deps( |
| 5498 CreateSpdySessionDependencies(GetParam())); | 5501 CreateSpdySessionDependencies(GetParam())); |
| 5499 session_deps->trusted_spdy_proxy = "123.45.67.89:8080"; | 5502 DefaultTrustedSpdyProxyProvider trusted_spdy_proxy_provider( |
| 5503 net::ProxyServer::FromURI("https://123.45.67.89:443", |
| 5504 net::ProxyServer::SCHEME_HTTP)); |
| 5505 session_deps->trusted_spdy_proxy_provider = |
| 5506 trusted_spdy_proxy_provider.GetWeakPtr(); |
| 5500 NormalSpdyTransactionHelper helper(request, DEFAULT_PRIORITY, BoundNetLog(), | 5507 NormalSpdyTransactionHelper helper(request, DEFAULT_PRIORITY, BoundNetLog(), |
| 5501 GetParam(), std::move(session_deps)); | 5508 GetParam(), std::move(session_deps)); |
| 5502 helper.RunPreTestSetup(); | 5509 helper.RunPreTestSetup(); |
| 5503 helper.AddData(&data); | 5510 helper.AddData(&data); |
| 5504 | 5511 |
| 5505 HttpNetworkTransaction* trans = helper.trans(); | 5512 HttpNetworkTransaction* trans = helper.trans(); |
| 5506 | 5513 |
| 5507 // Start the transaction with basic parameters. | 5514 // Start the transaction with basic parameters. |
| 5508 TestCompletionCallback callback; | 5515 TestCompletionCallback callback; |
| 5509 | 5516 |
| (...skipping 1044 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6554 TEST_P(SpdyNetworkTransactionTLSUsageCheckTest, TLSCipherSuiteSucky) { | 6561 TEST_P(SpdyNetworkTransactionTLSUsageCheckTest, TLSCipherSuiteSucky) { |
| 6555 scoped_ptr<SSLSocketDataProvider> ssl_provider( | 6562 scoped_ptr<SSLSocketDataProvider> ssl_provider( |
| 6556 new SSLSocketDataProvider(ASYNC, OK)); | 6563 new SSLSocketDataProvider(ASYNC, OK)); |
| 6557 // Set to TLS_RSA_WITH_NULL_MD5 | 6564 // Set to TLS_RSA_WITH_NULL_MD5 |
| 6558 SSLConnectionStatusSetCipherSuite(0x1, &ssl_provider->connection_status); | 6565 SSLConnectionStatusSetCipherSuite(0x1, &ssl_provider->connection_status); |
| 6559 | 6566 |
| 6560 RunTLSUsageCheckTest(std::move(ssl_provider)); | 6567 RunTLSUsageCheckTest(std::move(ssl_provider)); |
| 6561 } | 6568 } |
| 6562 | 6569 |
| 6563 } // namespace net | 6570 } // namespace net |
| OLD | NEW |