| 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 "base/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/bind_helpers.h" | 6 #include "base/bind_helpers.h" |
| 7 #include "base/callback.h" | 7 #include "base/callback.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/metrics/field_trial.h" | 9 #include "base/metrics/field_trial.h" |
| 10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 #include "content/public/test/download_test_observer.h" | 51 #include "content/public/test/download_test_observer.h" |
| 52 #include "content/public/test/test_renderer_host.h" | 52 #include "content/public/test/test_renderer_host.h" |
| 53 #include "net/base/net_errors.h" | 53 #include "net/base/net_errors.h" |
| 54 #include "net/base/test_data_directory.h" | 54 #include "net/base/test_data_directory.h" |
| 55 #include "net/cert/cert_status_flags.h" | 55 #include "net/cert/cert_status_flags.h" |
| 56 #include "net/cert/x509_certificate.h" | 56 #include "net/cert/x509_certificate.h" |
| 57 #include "net/ssl/ssl_info.h" | 57 #include "net/ssl/ssl_info.h" |
| 58 #include "net/test/spawned_test_server/spawned_test_server.h" | 58 #include "net/test/spawned_test_server/spawned_test_server.h" |
| 59 #include "net/url_request/url_request_context.h" | 59 #include "net/url_request/url_request_context.h" |
| 60 | 60 |
| 61 #if defined(USE_NSS) | 61 #if defined(USE_NSS_CERTS) |
| 62 #include "chrome/browser/net/nss_context.h" | 62 #include "chrome/browser/net/nss_context.h" |
| 63 #include "net/base/crypto_module.h" | 63 #include "net/base/crypto_module.h" |
| 64 #include "net/cert/nss_cert_database.h" | 64 #include "net/cert/nss_cert_database.h" |
| 65 #endif // defined(USE_NSS) | 65 #endif // defined(USE_NSS_CERTS) |
| 66 | 66 |
| 67 using base::ASCIIToUTF16; | 67 using base::ASCIIToUTF16; |
| 68 using chrome_browser_interstitials::SecurityInterstitialIDNTest; | 68 using chrome_browser_interstitials::SecurityInterstitialIDNTest; |
| 69 using chrome_browser_net::CertificateErrorReporter; | 69 using chrome_browser_net::CertificateErrorReporter; |
| 70 using content::InterstitialPage; | 70 using content::InterstitialPage; |
| 71 using content::NavigationController; | 71 using content::NavigationController; |
| 72 using content::NavigationEntry; | 72 using content::NavigationEntry; |
| 73 using content::SSLStatus; | 73 using content::SSLStatus; |
| 74 using content::WebContents; | 74 using content::WebContents; |
| 75 using web_modal::WebContentsModalDialogManager; | 75 using web_modal::WebContentsModalDialogManager; |
| (...skipping 889 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 965 | 965 |
| 966 // Proceed anyway. | 966 // Proceed anyway. |
| 967 ProceedThroughInterstitial(tab); | 967 ProceedThroughInterstitial(tab); |
| 968 | 968 |
| 969 // Test page run a WebSocket wss connection test. The result will be shown | 969 // Test page run a WebSocket wss connection test. The result will be shown |
| 970 // as page title. | 970 // as page title. |
| 971 const base::string16 result = watcher.WaitAndGetTitle(); | 971 const base::string16 result = watcher.WaitAndGetTitle(); |
| 972 EXPECT_TRUE(LowerCaseEqualsASCII(result, "pass")); | 972 EXPECT_TRUE(LowerCaseEqualsASCII(result, "pass")); |
| 973 } | 973 } |
| 974 | 974 |
| 975 #if defined(USE_NSS) | 975 #if defined(USE_NSS_CERTS) |
| 976 class SSLUITestWithClientCert : public SSLUITest { | 976 class SSLUITestWithClientCert : public SSLUITest { |
| 977 public: | 977 public: |
| 978 SSLUITestWithClientCert() : cert_db_(NULL) {} | 978 SSLUITestWithClientCert() : cert_db_(NULL) {} |
| 979 | 979 |
| 980 void SetUpOnMainThread() override { | 980 void SetUpOnMainThread() override { |
| 981 SSLUITest::SetUpOnMainThread(); | 981 SSLUITest::SetUpOnMainThread(); |
| 982 | 982 |
| 983 base::RunLoop loop; | 983 base::RunLoop loop; |
| 984 GetNSSCertDatabaseForProfile( | 984 GetNSSCertDatabaseForProfile( |
| 985 browser()->profile(), | 985 browser()->profile(), |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1051 | 1051 |
| 1052 // Visit a HTTPS page which requires client certs. | 1052 // Visit a HTTPS page which requires client certs. |
| 1053 ui_test_utils::NavigateToURL(browser(), url); | 1053 ui_test_utils::NavigateToURL(browser(), url); |
| 1054 CheckAuthenticatedState(tab, AuthState::NONE); | 1054 CheckAuthenticatedState(tab, AuthState::NONE); |
| 1055 | 1055 |
| 1056 // Test page runs a WebSocket wss connection test. The result will be shown | 1056 // Test page runs a WebSocket wss connection test. The result will be shown |
| 1057 // as page title. | 1057 // as page title. |
| 1058 const base::string16 result = watcher.WaitAndGetTitle(); | 1058 const base::string16 result = watcher.WaitAndGetTitle(); |
| 1059 EXPECT_TRUE(LowerCaseEqualsASCII(result, "pass")); | 1059 EXPECT_TRUE(LowerCaseEqualsASCII(result, "pass")); |
| 1060 } | 1060 } |
| 1061 #endif // defined(USE_NSS) | 1061 #endif // defined(USE_NSS_CERTS) |
| 1062 | 1062 |
| 1063 // Flaky on CrOS http://crbug.com/92292 | 1063 // Flaky on CrOS http://crbug.com/92292 |
| 1064 #if defined(OS_CHROMEOS) | 1064 #if defined(OS_CHROMEOS) |
| 1065 #define MAYBE_TestHTTPSErrorWithNoNavEntry \ | 1065 #define MAYBE_TestHTTPSErrorWithNoNavEntry \ |
| 1066 DISABLED_TestHTTPSErrorWithNoNavEntry | 1066 DISABLED_TestHTTPSErrorWithNoNavEntry |
| 1067 #else | 1067 #else |
| 1068 #define MAYBE_TestHTTPSErrorWithNoNavEntry TestHTTPSErrorWithNoNavEntry | 1068 #define MAYBE_TestHTTPSErrorWithNoNavEntry TestHTTPSErrorWithNoNavEntry |
| 1069 #endif // defined(OS_CHROMEOS) | 1069 #endif // defined(OS_CHROMEOS) |
| 1070 | 1070 |
| 1071 // Open a page with a HTTPS error in a tab with no prior navigation (through a | 1071 // Open a page with a HTTPS error in a tab with no prior navigation (through a |
| (...skipping 1199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2271 | 2271 |
| 2272 // Visit a page over https that contains a frame with a redirect. | 2272 // Visit a page over https that contains a frame with a redirect. |
| 2273 | 2273 |
| 2274 // XMLHttpRequest insecure content in synchronous mode. | 2274 // XMLHttpRequest insecure content in synchronous mode. |
| 2275 | 2275 |
| 2276 // XMLHttpRequest insecure content in asynchronous mode. | 2276 // XMLHttpRequest insecure content in asynchronous mode. |
| 2277 | 2277 |
| 2278 // XMLHttpRequest over bad ssl in synchronous mode. | 2278 // XMLHttpRequest over bad ssl in synchronous mode. |
| 2279 | 2279 |
| 2280 // XMLHttpRequest over OK ssl in synchronous mode. | 2280 // XMLHttpRequest over OK ssl in synchronous mode. |
| OLD | NEW |