| 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" |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 return session_deps; | 133 return session_deps; |
| 134 } | 134 } |
| 135 | 135 |
| 136 } // namespace | 136 } // namespace |
| 137 | 137 |
| 138 class SpdyNetworkTransactionTest | 138 class SpdyNetworkTransactionTest |
| 139 : public ::testing::TestWithParam<SpdyNetworkTransactionTestParams> { | 139 : public ::testing::TestWithParam<SpdyNetworkTransactionTestParams> { |
| 140 protected: | 140 protected: |
| 141 SpdyNetworkTransactionTest() | 141 SpdyNetworkTransactionTest() |
| 142 : spdy_util_(GetParam().protocol, GetParam().priority_to_dependency) { | 142 : spdy_util_(GetParam().protocol, GetParam().priority_to_dependency) { |
| 143 SpdySession::SetPriorityDependencyDefaultForTesting( | 143 old_dependency_default_ = |
| 144 GetParam().priority_to_dependency); | 144 Http2PriorityDependencies::SetEnabledDefaultForTesting( |
| 145 GetParam().priority_to_dependency); |
| 145 spdy_util_.set_default_url(GURL(GetDefaultUrl())); | 146 spdy_util_.set_default_url(GURL(GetDefaultUrl())); |
| 146 } | 147 } |
| 147 | 148 |
| 148 virtual ~SpdyNetworkTransactionTest() { | 149 virtual ~SpdyNetworkTransactionTest() { |
| 149 // UploadDataStream may post a deletion tasks back to the message loop on | 150 // UploadDataStream may post a deletion tasks back to the message loop on |
| 150 // destruction. | 151 // destruction. |
| 151 upload_data_stream_.reset(); | 152 upload_data_stream_.reset(); |
| 152 base::RunLoop().RunUntilIdle(); | 153 base::RunLoop().RunUntilIdle(); |
| 153 SpdySession::SetPriorityDependencyDefaultForTesting(false); | 154 Http2PriorityDependencies::SetEnabledDefaultForTesting( |
| 155 old_dependency_default_); |
| 154 } | 156 } |
| 155 | 157 |
| 156 void SetUp() override { | 158 void SetUp() override { |
| 157 get_request_initialized_ = false; | 159 get_request_initialized_ = false; |
| 158 post_request_initialized_ = false; | 160 post_request_initialized_ = false; |
| 159 chunked_post_request_initialized_ = false; | 161 chunked_post_request_initialized_ = false; |
| 160 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); | 162 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); |
| 161 } | 163 } |
| 162 | 164 |
| 163 struct TransactionHelperResult { | 165 struct TransactionHelperResult { |
| (...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 665 scoped_ptr<ChunkedUploadDataStream> upload_chunked_data_stream_; | 667 scoped_ptr<ChunkedUploadDataStream> upload_chunked_data_stream_; |
| 666 scoped_ptr<UploadDataStream> upload_data_stream_; | 668 scoped_ptr<UploadDataStream> upload_data_stream_; |
| 667 bool get_request_initialized_; | 669 bool get_request_initialized_; |
| 668 bool post_request_initialized_; | 670 bool post_request_initialized_; |
| 669 bool chunked_post_request_initialized_; | 671 bool chunked_post_request_initialized_; |
| 670 HttpRequestInfo get_request_; | 672 HttpRequestInfo get_request_; |
| 671 HttpRequestInfo post_request_; | 673 HttpRequestInfo post_request_; |
| 672 HttpRequestInfo chunked_post_request_; | 674 HttpRequestInfo chunked_post_request_; |
| 673 HttpRequestInfo get_push_request_; | 675 HttpRequestInfo get_push_request_; |
| 674 base::ScopedTempDir temp_dir_; | 676 base::ScopedTempDir temp_dir_; |
| 677 bool old_dependency_default_; |
| 675 }; | 678 }; |
| 676 | 679 |
| 677 //----------------------------------------------------------------------------- | 680 //----------------------------------------------------------------------------- |
| 678 // All tests are run with three different connection types: SPDY after NPN | 681 // All tests are run with three different connection types: SPDY after NPN |
| 679 // negotiation, SPDY without SSL, and SPDY with SSL. | 682 // negotiation, SPDY without SSL, and SPDY with SSL. |
| 680 // | 683 // |
| 681 // TODO(akalin): Use ::testing::Combine() when we are able to use | 684 // TODO(akalin): Use ::testing::Combine() when we are able to use |
| 682 // <tr1/tuple>. | 685 // <tr1/tuple>. |
| 683 INSTANTIATE_TEST_CASE_P( | 686 INSTANTIATE_TEST_CASE_P( |
| 684 Spdy, | 687 Spdy, |
| (...skipping 5977 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6662 TEST_P(SpdyNetworkTransactionTLSUsageCheckTest, TLSCipherSuiteSucky) { | 6665 TEST_P(SpdyNetworkTransactionTLSUsageCheckTest, TLSCipherSuiteSucky) { |
| 6663 scoped_ptr<SSLSocketDataProvider> ssl_provider( | 6666 scoped_ptr<SSLSocketDataProvider> ssl_provider( |
| 6664 new SSLSocketDataProvider(ASYNC, OK)); | 6667 new SSLSocketDataProvider(ASYNC, OK)); |
| 6665 // Set to TLS_RSA_WITH_NULL_MD5 | 6668 // Set to TLS_RSA_WITH_NULL_MD5 |
| 6666 SSLConnectionStatusSetCipherSuite(0x1, &ssl_provider->connection_status); | 6669 SSLConnectionStatusSetCipherSuite(0x1, &ssl_provider->connection_status); |
| 6667 | 6670 |
| 6668 RunTLSUsageCheckTest(std::move(ssl_provider)); | 6671 RunTLSUsageCheckTest(std::move(ssl_provider)); |
| 6669 } | 6672 } |
| 6670 | 6673 |
| 6671 } // namespace net | 6674 } // namespace net |
| OLD | NEW |