Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1178)

Side by Side Diff: net/url_request/url_request_unittest.cc

Issue 367963007: Preserve transport errors for OpenSSL sockets. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sleevi comments; also fix last-minute bug introduced in patch set 2 (oops) Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/socket/ssl_client_socket_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "build/build_config.h" 5 #include "build/build_config.h"
6 6
7 #if defined(OS_WIN) 7 #if defined(OS_WIN)
8 #include <windows.h> 8 #include <windows.h>
9 #include <shlobj.h> 9 #include <shlobj.h>
10 #endif 10 #endif
(...skipping 7104 matching lines...) Expand 10 before | Expand all | Expand 10 after
7115 ssl_options.tls_intolerant = 7115 ssl_options.tls_intolerant =
7116 SpawnedTestServer::SSLOptions::TLS_INTOLERANT_ALL; 7116 SpawnedTestServer::SSLOptions::TLS_INTOLERANT_ALL;
7117 ssl_options.tls_intolerance_type = 7117 ssl_options.tls_intolerance_type =
7118 SpawnedTestServer::SSLOptions::TLS_INTOLERANCE_CLOSE; 7118 SpawnedTestServer::SSLOptions::TLS_INTOLERANCE_CLOSE;
7119 7119
7120 ASSERT_NO_FATAL_FAILURE(DoFallbackTest(ssl_options)); 7120 ASSERT_NO_FATAL_FAILURE(DoFallbackTest(ssl_options));
7121 ExpectConnection(SSL_CONNECTION_VERSION_SSL3); 7121 ExpectConnection(SSL_CONNECTION_VERSION_SSL3);
7122 } 7122 }
7123 7123
7124 // This test is disabled on Android because the remote test server doesn't cause 7124 // This test is disabled on Android because the remote test server doesn't cause
7125 // a TCP reset. It also does not pass on OpenSSL. https://crbug.com/372849 7125 // a TCP reset.
7126 #if !defined(OS_ANDROID) && !defined(USE_OPENSSL) 7126 #if !defined(OS_ANDROID)
7127 // Tests that a reset connection does not fallback down to SSL3. 7127 // Tests that a reset connection does not fallback down to SSL3.
7128 TEST_F(HTTPSFallbackTest, SSLv3NoFallbackReset) { 7128 TEST_F(HTTPSFallbackTest, SSLv3NoFallbackReset) {
7129 SpawnedTestServer::SSLOptions ssl_options( 7129 SpawnedTestServer::SSLOptions ssl_options(
7130 SpawnedTestServer::SSLOptions::CERT_OK); 7130 SpawnedTestServer::SSLOptions::CERT_OK);
7131 ssl_options.tls_intolerant = 7131 ssl_options.tls_intolerant =
7132 SpawnedTestServer::SSLOptions::TLS_INTOLERANT_ALL; 7132 SpawnedTestServer::SSLOptions::TLS_INTOLERANT_ALL;
7133 ssl_options.tls_intolerance_type = 7133 ssl_options.tls_intolerance_type =
7134 SpawnedTestServer::SSLOptions::TLS_INTOLERANCE_RESET; 7134 SpawnedTestServer::SSLOptions::TLS_INTOLERANCE_RESET;
7135 7135
7136 ASSERT_NO_FATAL_FAILURE(DoFallbackTest(ssl_options)); 7136 ASSERT_NO_FATAL_FAILURE(DoFallbackTest(ssl_options));
7137 ExpectFailure(ERR_CONNECTION_RESET); 7137 ExpectFailure(ERR_CONNECTION_RESET);
7138 } 7138 }
7139 #endif // !OS_ANDROID && !USE_OPENSSL 7139 #endif // !OS_ANDROID
7140 7140
7141 class HTTPSSessionTest : public testing::Test { 7141 class HTTPSSessionTest : public testing::Test {
7142 public: 7142 public:
7143 HTTPSSessionTest() : default_context_(true) { 7143 HTTPSSessionTest() : default_context_(true) {
7144 cert_verifier_.set_default_result(net::OK); 7144 cert_verifier_.set_default_result(net::OK);
7145 7145
7146 default_context_.set_network_delegate(&default_network_delegate_); 7146 default_context_.set_network_delegate(&default_network_delegate_);
7147 default_context_.set_cert_verifier(&cert_verifier_); 7147 default_context_.set_cert_verifier(&cert_verifier_);
7148 default_context_.Init(); 7148 default_context_.Init();
7149 } 7149 }
(...skipping 957 matching lines...) Expand 10 before | Expand all | Expand 10 after
8107 8107
8108 EXPECT_FALSE(r.is_pending()); 8108 EXPECT_FALSE(r.is_pending());
8109 EXPECT_EQ(1, d->response_started_count()); 8109 EXPECT_EQ(1, d->response_started_count());
8110 EXPECT_FALSE(d->received_data_before_response()); 8110 EXPECT_FALSE(d->received_data_before_response());
8111 EXPECT_EQ(d->bytes_received(), static_cast<int>(file_size)); 8111 EXPECT_EQ(d->bytes_received(), static_cast<int>(file_size));
8112 } 8112 }
8113 } 8113 }
8114 #endif // !defined(DISABLE_FTP_SUPPORT) 8114 #endif // !defined(DISABLE_FTP_SUPPORT)
8115 8115
8116 } // namespace net 8116 } // namespace net
OLDNEW
« no previous file with comments | « net/socket/ssl_client_socket_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698