| 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" |
| 11 #include "base/files/scoped_temp_dir.h" | 11 #include "base/files/scoped_temp_dir.h" |
| 12 #include "base/memory/scoped_vector.h" | 12 #include "base/memory/scoped_vector.h" |
| 13 #include "base/run_loop.h" | 13 #include "base/run_loop.h" |
| 14 #include "base/stl_util.h" | 14 #include "base/stl_util.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 "net/base/auth.h" | 17 #include "net/base/auth.h" |
| 18 #include "net/base/chunked_upload_data_stream.h" | 18 #include "net/base/chunked_upload_data_stream.h" |
| 19 #include "net/base/elements_upload_data_stream.h" | 19 #include "net/base/elements_upload_data_stream.h" |
| 20 #include "net/base/request_priority.h" | 20 #include "net/base/request_priority.h" |
| 21 #include "net/base/test_data_directory.h" | 21 #include "net/base/test_data_directory.h" |
| 22 #include "net/base/upload_bytes_element_reader.h" | 22 #include "net/base/upload_bytes_element_reader.h" |
| 23 #include "net/base/upload_file_element_reader.h" | 23 #include "net/base/upload_file_element_reader.h" |
| 24 #include "net/http/http_network_session_peer.h" | 24 #include "net/http/http_network_session_peer.h" |
| 25 #include "net/http/http_network_transaction.h" | 25 #include "net/http/http_network_transaction.h" |
| 26 #include "net/http/http_server_properties.h" | 26 #include "net/http/http_server_properties.h" |
| 27 #include "net/http/http_transaction_test_util.h" | 27 #include "net/http/http_transaction_test_util.h" |
| 28 #include "net/log/captured_net_log_entry.h" |
| 28 #include "net/log/net_log_unittest.h" | 29 #include "net/log/net_log_unittest.h" |
| 30 #include "net/log/test_net_log.h" |
| 29 #include "net/socket/client_socket_pool_base.h" | 31 #include "net/socket/client_socket_pool_base.h" |
| 30 #include "net/socket/next_proto.h" | 32 #include "net/socket/next_proto.h" |
| 31 #include "net/spdy/buffered_spdy_framer.h" | 33 #include "net/spdy/buffered_spdy_framer.h" |
| 32 #include "net/spdy/spdy_http_stream.h" | 34 #include "net/spdy/spdy_http_stream.h" |
| 33 #include "net/spdy/spdy_http_utils.h" | 35 #include "net/spdy/spdy_http_utils.h" |
| 34 #include "net/spdy/spdy_session.h" | 36 #include "net/spdy/spdy_session.h" |
| 35 #include "net/spdy/spdy_session_pool.h" | 37 #include "net/spdy/spdy_session_pool.h" |
| 36 #include "net/spdy/spdy_test_util_common.h" | 38 #include "net/spdy/spdy_test_util_common.h" |
| 37 #include "net/spdy/spdy_test_utils.h" | 39 #include "net/spdy/spdy_test_utils.h" |
| 38 #include "net/ssl/ssl_connection_status_flags.h" | 40 #include "net/ssl/ssl_connection_status_flags.h" |
| (...skipping 3630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3669 helper.RunToCompletion(&data); | 3671 helper.RunToCompletion(&data); |
| 3670 TransactionHelperResult out = helper.output(); | 3672 TransactionHelperResult out = helper.output(); |
| 3671 EXPECT_EQ(OK, out.rv); | 3673 EXPECT_EQ(OK, out.rv); |
| 3672 EXPECT_EQ("HTTP/1.1 200 OK", out.status_line); | 3674 EXPECT_EQ("HTTP/1.1 200 OK", out.status_line); |
| 3673 EXPECT_EQ("hello!", out.response_data); | 3675 EXPECT_EQ("hello!", out.response_data); |
| 3674 | 3676 |
| 3675 // Check that the NetLog was filled reasonably. | 3677 // Check that the NetLog was filled reasonably. |
| 3676 // This test is intentionally non-specific about the exact ordering of the | 3678 // This test is intentionally non-specific about the exact ordering of the |
| 3677 // log; instead we just check to make sure that certain events exist, and that | 3679 // log; instead we just check to make sure that certain events exist, and that |
| 3678 // they are in the right order. | 3680 // they are in the right order. |
| 3679 TestNetLog::CapturedEntryList entries; | 3681 CapturedNetLogEntry::List entries; |
| 3680 log.GetEntries(&entries); | 3682 log.GetEntries(&entries); |
| 3681 | 3683 |
| 3682 EXPECT_LT(0u, entries.size()); | 3684 EXPECT_LT(0u, entries.size()); |
| 3683 int pos = 0; | 3685 int pos = 0; |
| 3684 pos = ExpectLogContainsSomewhere(entries, 0, | 3686 pos = ExpectLogContainsSomewhere(entries, 0, |
| 3685 NetLog::TYPE_HTTP_TRANSACTION_SEND_REQUEST, | 3687 NetLog::TYPE_HTTP_TRANSACTION_SEND_REQUEST, |
| 3686 NetLog::PHASE_BEGIN); | 3688 NetLog::PHASE_BEGIN); |
| 3687 pos = ExpectLogContainsSomewhere(entries, pos + 1, | 3689 pos = ExpectLogContainsSomewhere(entries, pos + 1, |
| 3688 NetLog::TYPE_HTTP_TRANSACTION_SEND_REQUEST, | 3690 NetLog::TYPE_HTTP_TRANSACTION_SEND_REQUEST, |
| 3689 NetLog::PHASE_END); | 3691 NetLog::PHASE_END); |
| (...skipping 3010 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6700 TEST_P(SpdyNetworkTransactionTLSUsageCheckTest, TLSCipherSuiteSucky) { | 6702 TEST_P(SpdyNetworkTransactionTLSUsageCheckTest, TLSCipherSuiteSucky) { |
| 6701 scoped_ptr<SSLSocketDataProvider> ssl_provider( | 6703 scoped_ptr<SSLSocketDataProvider> ssl_provider( |
| 6702 new SSLSocketDataProvider(ASYNC, OK)); | 6704 new SSLSocketDataProvider(ASYNC, OK)); |
| 6703 // Set to TLS_RSA_WITH_NULL_MD5 | 6705 // Set to TLS_RSA_WITH_NULL_MD5 |
| 6704 SSLConnectionStatusSetCipherSuite(0x1, &ssl_provider->connection_status); | 6706 SSLConnectionStatusSetCipherSuite(0x1, &ssl_provider->connection_status); |
| 6705 | 6707 |
| 6706 RunTLSUsageCheckTest(ssl_provider.Pass()); | 6708 RunTLSUsageCheckTest(ssl_provider.Pass()); |
| 6707 } | 6709 } |
| 6708 | 6710 |
| 6709 } // namespace net | 6711 } // namespace net |
| OLD | NEW |