| 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 "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 1807 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1818 EXPECT_NE(0, d.bytes_received()); | 1818 EXPECT_NE(0, d.bytes_received()); |
| 1819 EXPECT_EQ(static_cast<int>(SSL_CONNECTION_VERSION_SSL3), | 1819 EXPECT_EQ(static_cast<int>(SSL_CONNECTION_VERSION_SSL3), |
| 1820 SSLConnectionStatusToVersion(r.ssl_info().connection_status)); | 1820 SSLConnectionStatusToVersion(r.ssl_info().connection_status)); |
| 1821 EXPECT_TRUE(r.ssl_info().connection_status & SSL_CONNECTION_VERSION_FALLBACK); | 1821 EXPECT_TRUE(r.ssl_info().connection_status & SSL_CONNECTION_VERSION_FALLBACK); |
| 1822 } | 1822 } |
| 1823 | 1823 |
| 1824 // Tests TLSv1.1 -> TLSv1 fallback. Verifies that we don't fall back more | 1824 // Tests TLSv1.1 -> TLSv1 fallback. Verifies that we don't fall back more |
| 1825 // than necessary. | 1825 // than necessary. |
| 1826 TEST_F(HTTPSRequestTest, TLSv1Fallback) { | 1826 TEST_F(HTTPSRequestTest, TLSv1Fallback) { |
| 1827 uint16 default_version_max = SSLConfigService::default_version_max(); | 1827 uint16 default_version_max = SSLConfigService::default_version_max(); |
| 1828 // The OpenSSL library in use may not support TLS 1.1. |
| 1829 #if !defined(USE_OPENSSL) |
| 1830 EXPECT_GT(default_version_max, SSL_PROTOCOL_VERSION_TLS1); |
| 1831 #endif |
| 1828 if (default_version_max <= SSL_PROTOCOL_VERSION_TLS1) | 1832 if (default_version_max <= SSL_PROTOCOL_VERSION_TLS1) |
| 1829 return; | 1833 return; |
| 1830 | 1834 |
| 1831 TestServer::HTTPSOptions https_options( | 1835 TestServer::HTTPSOptions https_options( |
| 1832 TestServer::HTTPSOptions::CERT_OK); | 1836 TestServer::HTTPSOptions::CERT_OK); |
| 1833 https_options.tls_intolerant = | 1837 https_options.tls_intolerant = |
| 1834 TestServer::HTTPSOptions::TLS_INTOLERANT_TLS1_1; | 1838 TestServer::HTTPSOptions::TLS_INTOLERANT_TLS1_1; |
| 1835 TestServer test_server(https_options, | 1839 TestServer test_server(https_options, |
| 1836 FilePath(FILE_PATH_LITERAL("net/data/ssl"))); | 1840 FilePath(FILE_PATH_LITERAL("net/data/ssl"))); |
| 1837 ASSERT_TRUE(test_server.Start()); | 1841 ASSERT_TRUE(test_server.Start()); |
| (...skipping 2820 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4658 req.SetExtraRequestHeaders(headers); | 4662 req.SetExtraRequestHeaders(headers); |
| 4659 req.Start(); | 4663 req.Start(); |
| 4660 MessageLoop::current()->Run(); | 4664 MessageLoop::current()->Run(); |
| 4661 // If the net tests are being run with ChromeFrame then we need to allow for | 4665 // If the net tests are being run with ChromeFrame then we need to allow for |
| 4662 // the 'chromeframe' suffix which is added to the user agent before the | 4666 // the 'chromeframe' suffix which is added to the user agent before the |
| 4663 // closing parentheses. | 4667 // closing parentheses. |
| 4664 EXPECT_TRUE(StartsWithASCII(d.data_received(), "Lynx (textmode", true)); | 4668 EXPECT_TRUE(StartsWithASCII(d.data_received(), "Lynx (textmode", true)); |
| 4665 } | 4669 } |
| 4666 | 4670 |
| 4667 } // namespace net | 4671 } // namespace net |
| OLD | NEW |