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 1393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1404 if (err_allowed) { | 1404 if (err_allowed) { |
1405 EXPECT_NE(0, d.bytes_received()); | 1405 EXPECT_NE(0, d.bytes_received()); |
1406 CheckSSLInfo(r.ssl_info()); | 1406 CheckSSLInfo(r.ssl_info()); |
1407 } else { | 1407 } else { |
1408 EXPECT_EQ(0, d.bytes_received()); | 1408 EXPECT_EQ(0, d.bytes_received()); |
1409 } | 1409 } |
1410 } | 1410 } |
1411 } | 1411 } |
1412 } | 1412 } |
1413 | 1413 |
1414 // Disabled on Android - http://crbug.com/119642 - The Android test server | |
1415 // does not support generating OCSP responses on the fly. | |
1416 #if !defined(OS_ANDROID) | |
1417 | |
1418 class TestSSLConfigService : public SSLConfigService { | 1414 class TestSSLConfigService : public SSLConfigService { |
1419 public: | 1415 public: |
1420 TestSSLConfigService(bool ev_enabled, bool online_rev_checking) | 1416 TestSSLConfigService(bool ev_enabled, bool online_rev_checking) |
1421 : ev_enabled_(ev_enabled), | 1417 : ev_enabled_(ev_enabled), |
1422 online_rev_checking_(online_rev_checking) { | 1418 online_rev_checking_(online_rev_checking) { |
1423 } | 1419 } |
1424 | 1420 |
1425 virtual void GetSSLConfig(SSLConfig* config) { | 1421 virtual void GetSSLConfig(SSLConfig* config) { |
1426 *config = SSLConfig(); | 1422 *config = SSLConfig(); |
1427 config->rev_checking_enabled = online_rev_checking_; | 1423 config->rev_checking_enabled = online_rev_checking_; |
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1723 CertStatus cert_status; | 1719 CertStatus cert_status; |
1724 DoConnection(https_options, &cert_status); | 1720 DoConnection(https_options, &cert_status); |
1725 | 1721 |
1726 // If we're not trying EV verification then, even if the CRLSet has expired, | 1722 // If we're not trying EV verification then, even if the CRLSet has expired, |
1727 // we don't fall back to online revocation checks. | 1723 // we don't fall back to online revocation checks. |
1728 EXPECT_EQ(0u, cert_status & CERT_STATUS_ALL_ERRORS); | 1724 EXPECT_EQ(0u, cert_status & CERT_STATUS_ALL_ERRORS); |
1729 EXPECT_FALSE(cert_status & CERT_STATUS_IS_EV); | 1725 EXPECT_FALSE(cert_status & CERT_STATUS_IS_EV); |
1730 EXPECT_FALSE(cert_status & CERT_STATUS_REV_CHECKING_ENABLED); | 1726 EXPECT_FALSE(cert_status & CERT_STATUS_REV_CHECKING_ENABLED); |
1731 } | 1727 } |
1732 | 1728 |
1733 #endif // !defined(OS_ANDROID) | |
1734 | |
1735 // This tests that a load of www.google.com with a certificate error sets | 1729 // This tests that a load of www.google.com with a certificate error sets |
1736 // the |certificate_errors_are_fatal| flag correctly. This flag will cause | 1730 // the |certificate_errors_are_fatal| flag correctly. This flag will cause |
1737 // the interstitial to be fatal. | 1731 // the interstitial to be fatal. |
1738 TEST_F(HTTPSRequestTest, HTTPSPreloadedHSTSTest) { | 1732 TEST_F(HTTPSRequestTest, HTTPSPreloadedHSTSTest) { |
1739 TestServer::HTTPSOptions https_options( | 1733 TestServer::HTTPSOptions https_options( |
1740 TestServer::HTTPSOptions::CERT_MISMATCHED_NAME); | 1734 TestServer::HTTPSOptions::CERT_MISMATCHED_NAME); |
1741 TestServer test_server(https_options, | 1735 TestServer test_server(https_options, |
1742 FilePath(FILE_PATH_LITERAL("net/data/ssl"))); | 1736 FilePath(FILE_PATH_LITERAL("net/data/ssl"))); |
1743 ASSERT_TRUE(test_server.Start()); | 1737 ASSERT_TRUE(test_server.Start()); |
1744 | 1738 |
(...skipping 2818 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4563 req.SetExtraRequestHeaders(headers); | 4557 req.SetExtraRequestHeaders(headers); |
4564 req.Start(); | 4558 req.Start(); |
4565 MessageLoop::current()->Run(); | 4559 MessageLoop::current()->Run(); |
4566 // If the net tests are being run with ChromeFrame then we need to allow for | 4560 // If the net tests are being run with ChromeFrame then we need to allow for |
4567 // the 'chromeframe' suffix which is added to the user agent before the | 4561 // the 'chromeframe' suffix which is added to the user agent before the |
4568 // closing parentheses. | 4562 // closing parentheses. |
4569 EXPECT_TRUE(StartsWithASCII(d.data_received(), "Lynx (textmode", true)); | 4563 EXPECT_TRUE(StartsWithASCII(d.data_received(), "Lynx (textmode", true)); |
4570 } | 4564 } |
4571 | 4565 |
4572 } // namespace net | 4566 } // namespace net |
OLD | NEW |