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