| 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 <cmath> | 5 #include <cmath> |
| 6 #include <memory> | 6 #include <memory> |
| 7 #include <string> | 7 #include <string> |
| 8 #include <utility> | 8 #include <utility> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/bind.h" | 11 #include "base/bind.h" |
| 12 #include "base/bind_helpers.h" | 12 #include "base/bind_helpers.h" |
| 13 #include "base/files/file_util.h" | 13 #include "base/files/file_util.h" |
| 14 #include "base/files/scoped_temp_dir.h" | 14 #include "base/files/scoped_temp_dir.h" |
| 15 #include "base/memory/ptr_util.h" | 15 #include "base/memory/ptr_util.h" |
| 16 #include "base/run_loop.h" | 16 #include "base/run_loop.h" |
| 17 #include "base/strings/string_piece.h" | 17 #include "base/strings/string_piece.h" |
| 18 #include "base/test/test_file_util.h" | 18 #include "base/test/test_file_util.h" |
| 19 #include "base/threading/thread_task_runner_handle.h" | 19 #include "base/threading/thread_task_runner_handle.h" |
| 20 #include "net/base/auth.h" | 20 #include "net/base/auth.h" |
| 21 #include "net/base/chunked_upload_data_stream.h" | 21 #include "net/base/chunked_upload_data_stream.h" |
| 22 #include "net/base/elements_upload_data_stream.h" | 22 #include "net/base/elements_upload_data_stream.h" |
| 23 #include "net/base/proxy_delegate.h" | 23 #include "net/base/proxy_delegate.h" |
| 24 #include "net/base/request_priority.h" | 24 #include "net/base/request_priority.h" |
| 25 #include "net/base/test_proxy_delegate.h" | 25 #include "net/base/test_proxy_delegate.h" |
| 26 #include "net/base/upload_bytes_element_reader.h" | 26 #include "net/base/upload_bytes_element_reader.h" |
| 27 #include "net/base/upload_file_element_reader.h" | 27 #include "net/base/upload_file_element_reader.h" |
| 28 #include "net/http/http_auth_scheme.h" | 28 #include "net/http/http_auth_scheme.h" |
| 29 #include "net/http/http_network_session.h" |
| 29 #include "net/http/http_network_session_peer.h" | 30 #include "net/http/http_network_session_peer.h" |
| 30 #include "net/http/http_network_transaction.h" | 31 #include "net/http/http_network_transaction.h" |
| 31 #include "net/http/http_server_properties.h" | 32 #include "net/http/http_server_properties.h" |
| 32 #include "net/http/http_transaction_test_util.h" | 33 #include "net/http/http_transaction_test_util.h" |
| 33 #include "net/log/net_log_event_type.h" | 34 #include "net/log/net_log_event_type.h" |
| 34 #include "net/log/net_log_with_source.h" | 35 #include "net/log/net_log_with_source.h" |
| 35 #include "net/log/test_net_log.h" | 36 #include "net/log/test_net_log.h" |
| 36 #include "net/log/test_net_log_entry.h" | 37 #include "net/log/test_net_log_entry.h" |
| 37 #include "net/log/test_net_log_util.h" | 38 #include "net/log/test_net_log_util.h" |
| 38 #include "net/proxy/proxy_server.h" | 39 #include "net/proxy/proxy_server.h" |
| (...skipping 5271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5310 const int32_t kChunkSize = 4096; | 5311 const int32_t kChunkSize = 4096; |
| 5311 // Size of window updates. | 5312 // Size of window updates. |
| 5312 ASSERT_EQ(0, session_max_recv_window_size / 2 % kChunkSize); | 5313 ASSERT_EQ(0, session_max_recv_window_size / 2 % kChunkSize); |
| 5313 const int32_t session_window_update_delta = | 5314 const int32_t session_window_update_delta = |
| 5314 session_max_recv_window_size / 2 + kChunkSize; | 5315 session_max_recv_window_size / 2 + kChunkSize; |
| 5315 ASSERT_EQ(0, stream_max_recv_window_size / 2 % kChunkSize); | 5316 ASSERT_EQ(0, stream_max_recv_window_size / 2 % kChunkSize); |
| 5316 const int32_t stream_window_update_delta = | 5317 const int32_t stream_window_update_delta = |
| 5317 stream_max_recv_window_size / 2 + kChunkSize; | 5318 stream_max_recv_window_size / 2 + kChunkSize; |
| 5318 | 5319 |
| 5319 SettingsMap initial_settings; | 5320 SettingsMap initial_settings; |
| 5320 initial_settings[SETTINGS_HEADER_TABLE_SIZE] = kMaxHeaderTableSize; | 5321 initial_settings[SETTINGS_HEADER_TABLE_SIZE] = kSpdyMaxHeaderTableSize; |
| 5321 initial_settings[SETTINGS_MAX_CONCURRENT_STREAMS] = | 5322 initial_settings[SETTINGS_MAX_CONCURRENT_STREAMS] = |
| 5322 kMaxConcurrentPushedStreams; | 5323 kSpdyMaxConcurrentPushedStreams; |
| 5323 initial_settings[SETTINGS_INITIAL_WINDOW_SIZE] = stream_max_recv_window_size; | 5324 initial_settings[SETTINGS_INITIAL_WINDOW_SIZE] = stream_max_recv_window_size; |
| 5324 SpdySerializedFrame initial_settings_frame( | 5325 SpdySerializedFrame initial_settings_frame( |
| 5325 spdy_util_.ConstructSpdySettings(initial_settings)); | 5326 spdy_util_.ConstructSpdySettings(initial_settings)); |
| 5326 SpdySerializedFrame initial_window_update( | 5327 SpdySerializedFrame initial_window_update( |
| 5327 spdy_util_.ConstructSpdyWindowUpdate( | 5328 spdy_util_.ConstructSpdyWindowUpdate( |
| 5328 kSessionFlowControlStreamId, | 5329 kSessionFlowControlStreamId, |
| 5329 session_max_recv_window_size - kDefaultInitialWindowSize)); | 5330 session_max_recv_window_size - kDefaultInitialWindowSize)); |
| 5330 SpdySerializedFrame req( | 5331 SpdySerializedFrame req( |
| 5331 spdy_util_.ConstructSpdyGet(nullptr, 0, 1, LOWEST, true)); | 5332 spdy_util_.ConstructSpdyGet(nullptr, 0, 1, LOWEST, true)); |
| 5332 SpdySerializedFrame session_window_update( | 5333 SpdySerializedFrame session_window_update( |
| (...skipping 29 matching lines...) Expand all Loading... |
| 5362 writes.push_back( | 5363 writes.push_back( |
| 5363 CreateMockWrite(session_window_update, writes.size() + reads.size())); | 5364 CreateMockWrite(session_window_update, writes.size() + reads.size())); |
| 5364 writes.push_back( | 5365 writes.push_back( |
| 5365 CreateMockWrite(stream_window_update, writes.size() + reads.size())); | 5366 CreateMockWrite(stream_window_update, writes.size() + reads.size())); |
| 5366 | 5367 |
| 5367 SequencedSocketData data(reads.data(), reads.size(), writes.data(), | 5368 SequencedSocketData data(reads.data(), reads.size(), writes.data(), |
| 5368 writes.size()); | 5369 writes.size()); |
| 5369 | 5370 |
| 5370 auto session_deps = base::MakeUnique<SpdySessionDependencies>(); | 5371 auto session_deps = base::MakeUnique<SpdySessionDependencies>(); |
| 5371 session_deps->session_max_recv_window_size = session_max_recv_window_size; | 5372 session_deps->session_max_recv_window_size = session_max_recv_window_size; |
| 5372 session_deps->stream_max_recv_window_size = stream_max_recv_window_size; | 5373 session_deps->http2_settings[SETTINGS_INITIAL_WINDOW_SIZE] = |
| 5374 stream_max_recv_window_size; |
| 5373 | 5375 |
| 5374 NormalSpdyTransactionHelper helper(CreateGetRequest(), DEFAULT_PRIORITY, | 5376 NormalSpdyTransactionHelper helper(CreateGetRequest(), DEFAULT_PRIORITY, |
| 5375 NetLogWithSource(), | 5377 NetLogWithSource(), |
| 5376 std::move(session_deps)); | 5378 std::move(session_deps)); |
| 5377 helper.AddData(&data); | 5379 helper.AddData(&data); |
| 5378 helper.RunPreTestSetup(); | 5380 helper.RunPreTestSetup(); |
| 5379 | 5381 |
| 5380 SpdySessionPool* spdy_session_pool = helper.session()->spdy_session_pool(); | 5382 SpdySessionPool* spdy_session_pool = helper.session()->spdy_session_pool(); |
| 5381 SpdySessionPoolPeer pool_peer(spdy_session_pool); | 5383 SpdySessionPoolPeer pool_peer(spdy_session_pool); |
| 5382 pool_peer.SetEnableSendingInitialData(true); | 5384 pool_peer.SetEnableSendingInitialData(true); |
| (...skipping 886 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6269 TEST_F(SpdyNetworkTransactionTLSUsageCheckTest, TLSCipherSuiteSucky) { | 6271 TEST_F(SpdyNetworkTransactionTLSUsageCheckTest, TLSCipherSuiteSucky) { |
| 6270 std::unique_ptr<SSLSocketDataProvider> ssl_provider( | 6272 std::unique_ptr<SSLSocketDataProvider> ssl_provider( |
| 6271 new SSLSocketDataProvider(ASYNC, OK)); | 6273 new SSLSocketDataProvider(ASYNC, OK)); |
| 6272 // Set to TLS_RSA_WITH_NULL_MD5 | 6274 // Set to TLS_RSA_WITH_NULL_MD5 |
| 6273 SSLConnectionStatusSetCipherSuite(0x1, &ssl_provider->connection_status); | 6275 SSLConnectionStatusSetCipherSuite(0x1, &ssl_provider->connection_status); |
| 6274 | 6276 |
| 6275 RunTLSUsageCheckTest(std::move(ssl_provider)); | 6277 RunTLSUsageCheckTest(std::move(ssl_provider)); |
| 6276 } | 6278 } |
| 6277 | 6279 |
| 6278 } // namespace net | 6280 } // namespace net |
| OLD | NEW |