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

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

Issue 10412042: Improve the TLS intolerant server testing support added in r134129 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Tweak enumerator names Created 8 years, 7 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/tools/testserver/testserver.py ('k') | third_party/tlslite/patches/tls_intolerant.patch » ('j') | 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 1710 matching lines...) Expand 10 before | Expand all | Expand 10 after
1721 // If we're not trying EV verification then, even if the CRLSet has expired, 1721 // If we're not trying EV verification then, even if the CRLSet has expired,
1722 // we don't fall back to online revocation checks. 1722 // we don't fall back to online revocation checks.
1723 EXPECT_EQ(0u, cert_status & CERT_STATUS_ALL_ERRORS); 1723 EXPECT_EQ(0u, cert_status & CERT_STATUS_ALL_ERRORS);
1724 EXPECT_FALSE(cert_status & CERT_STATUS_IS_EV); 1724 EXPECT_FALSE(cert_status & CERT_STATUS_IS_EV);
1725 EXPECT_FALSE(cert_status & CERT_STATUS_REV_CHECKING_ENABLED); 1725 EXPECT_FALSE(cert_status & CERT_STATUS_REV_CHECKING_ENABLED);
1726 } 1726 }
1727 1727
1728 TEST_F(HTTPSRequestTest, SSLv3Fallback) { 1728 TEST_F(HTTPSRequestTest, SSLv3Fallback) {
1729 TestServer::HTTPSOptions https_options( 1729 TestServer::HTTPSOptions https_options(
1730 TestServer::HTTPSOptions::CERT_OK); 1730 TestServer::HTTPSOptions::CERT_OK);
1731 https_options.tls_intolerant = true; 1731 https_options.tls_intolerant = TestServer::HTTPSOptions::TLS_INTOLERANT_ALL;
1732 TestServer test_server(https_options, 1732 TestServer test_server(https_options,
1733 FilePath(FILE_PATH_LITERAL("net/data/ssl"))); 1733 FilePath(FILE_PATH_LITERAL("net/data/ssl")));
1734 ASSERT_TRUE(test_server.Start()); 1734 ASSERT_TRUE(test_server.Start());
1735 1735
1736 TestDelegate d; 1736 TestDelegate d;
1737 TestURLRequestContext context(true); 1737 TestURLRequestContext context(true);
1738 context.Init(); 1738 context.Init();
1739 d.set_allow_certificate_errors(true); 1739 d.set_allow_certificate_errors(true);
1740 URLRequest r(test_server.GetURL(""), &d); 1740 URLRequest r(test_server.GetURL(""), &d);
1741 r.set_context(&context); 1741 r.set_context(&context);
1742 r.Start(); 1742 r.Start();
1743 1743
1744 MessageLoop::current()->Run(); 1744 MessageLoop::current()->Run();
1745 1745
1746 EXPECT_EQ(1, d.response_started_count()); 1746 EXPECT_EQ(1, d.response_started_count());
1747 EXPECT_NE(0, d.bytes_received()); 1747 EXPECT_NE(0, d.bytes_received());
1748 EXPECT_EQ(SSL_CONNECTION_VERSION_SSL3,
1749 SSLConnectionStatusToVersion(r.ssl_info().connection_status));
1748 EXPECT_TRUE(r.ssl_info().connection_status & SSL_CONNECTION_SSL3_FALLBACK); 1750 EXPECT_TRUE(r.ssl_info().connection_status & SSL_CONNECTION_SSL3_FALLBACK);
1749 } 1751 }
1750 1752
1751 // This tests that a load of www.google.com with a certificate error sets 1753 // This tests that a load of www.google.com with a certificate error sets
1752 // the |certificate_errors_are_fatal| flag correctly. This flag will cause 1754 // the |certificate_errors_are_fatal| flag correctly. This flag will cause
1753 // the interstitial to be fatal. 1755 // the interstitial to be fatal.
1754 TEST_F(HTTPSRequestTest, HTTPSPreloadedHSTSTest) { 1756 TEST_F(HTTPSRequestTest, HTTPSPreloadedHSTSTest) {
1755 TestServer::HTTPSOptions https_options( 1757 TestServer::HTTPSOptions https_options(
1756 TestServer::HTTPSOptions::CERT_MISMATCHED_NAME); 1758 TestServer::HTTPSOptions::CERT_MISMATCHED_NAME);
1757 TestServer test_server(https_options, 1759 TestServer test_server(https_options,
(...skipping 2849 matching lines...) Expand 10 before | Expand all | Expand 10 after
4607 req.SetExtraRequestHeaders(headers); 4609 req.SetExtraRequestHeaders(headers);
4608 req.Start(); 4610 req.Start();
4609 MessageLoop::current()->Run(); 4611 MessageLoop::current()->Run();
4610 // If the net tests are being run with ChromeFrame then we need to allow for 4612 // If the net tests are being run with ChromeFrame then we need to allow for
4611 // the 'chromeframe' suffix which is added to the user agent before the 4613 // the 'chromeframe' suffix which is added to the user agent before the
4612 // closing parentheses. 4614 // closing parentheses.
4613 EXPECT_TRUE(StartsWithASCII(d.data_received(), "Lynx (textmode", true)); 4615 EXPECT_TRUE(StartsWithASCII(d.data_received(), "Lynx (textmode", true));
4614 } 4616 }
4615 4617
4616 } // namespace net 4618 } // namespace net
OLDNEW
« no previous file with comments | « net/tools/testserver/testserver.py ('k') | third_party/tlslite/patches/tls_intolerant.patch » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698