| 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/location.h" | 9 #include "base/location.h" |
| 10 #include "base/metrics/field_trial.h" | 10 #include "base/metrics/field_trial.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 #include "chrome/browser/ssl/certificate_reporting_test_utils.h" | 29 #include "chrome/browser/ssl/certificate_reporting_test_utils.h" |
| 30 #include "chrome/browser/ssl/chrome_ssl_host_state_delegate.h" | 30 #include "chrome/browser/ssl/chrome_ssl_host_state_delegate.h" |
| 31 #include "chrome/browser/ssl/common_name_mismatch_handler.h" | 31 #include "chrome/browser/ssl/common_name_mismatch_handler.h" |
| 32 #include "chrome/browser/ssl/security_state_model.h" | 32 #include "chrome/browser/ssl/security_state_model.h" |
| 33 #include "chrome/browser/ssl/ssl_blocking_page.h" | 33 #include "chrome/browser/ssl/ssl_blocking_page.h" |
| 34 #include "chrome/browser/ssl/ssl_error_classification.h" | 34 #include "chrome/browser/ssl/ssl_error_classification.h" |
| 35 #include "chrome/browser/ssl/ssl_error_handler.h" | 35 #include "chrome/browser/ssl/ssl_error_handler.h" |
| 36 #include "chrome/browser/ui/browser.h" | 36 #include "chrome/browser/ui/browser.h" |
| 37 #include "chrome/browser/ui/browser_commands.h" | 37 #include "chrome/browser/ui/browser_commands.h" |
| 38 #include "chrome/browser/ui/browser_navigator.h" | 38 #include "chrome/browser/ui/browser_navigator.h" |
| 39 #include "chrome/browser/ui/browser_navigator_params.h" |
| 39 #include "chrome/browser/ui/browser_tabstrip.h" | 40 #include "chrome/browser/ui/browser_tabstrip.h" |
| 40 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 41 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 41 #include "chrome/common/chrome_paths.h" | 42 #include "chrome/common/chrome_paths.h" |
| 42 #include "chrome/common/chrome_switches.h" | 43 #include "chrome/common/chrome_switches.h" |
| 43 #include "chrome/common/pref_names.h" | 44 #include "chrome/common/pref_names.h" |
| 44 #include "chrome/test/base/in_process_browser_test.h" | 45 #include "chrome/test/base/in_process_browser_test.h" |
| 45 #include "chrome/test/base/ui_test_utils.h" | 46 #include "chrome/test/base/ui_test_utils.h" |
| 46 #include "components/content_settings/core/browser/host_content_settings_map.h" | 47 #include "components/content_settings/core/browser/host_content_settings_map.h" |
| 47 #include "components/security_interstitials/core/metrics_helper.h" | 48 #include "components/security_interstitials/core/metrics_helper.h" |
| 48 #include "components/variations/variations_associated_data.h" | 49 #include "components/variations/variations_associated_data.h" |
| (...skipping 1048 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1097 EXPECT_EQ(SecurityStateModel::NONE, model->GetSecurityInfo().security_level); | 1098 EXPECT_EQ(SecurityStateModel::NONE, model->GetSecurityInfo().security_level); |
| 1098 | 1099 |
| 1099 ui_test_utils::NavigateToURL( | 1100 ui_test_utils::NavigateToURL( |
| 1100 browser(), | 1101 browser(), |
| 1101 GURL("blob:chrome%3A//newtab/49a463bb-fac8-476c-97bf-5d7076c3ea1a")); | 1102 GURL("blob:chrome%3A//newtab/49a463bb-fac8-476c-97bf-5d7076c3ea1a")); |
| 1102 EXPECT_EQ(SecurityStateModel::NONE, model->GetSecurityInfo().security_level); | 1103 EXPECT_EQ(SecurityStateModel::NONE, model->GetSecurityInfo().security_level); |
| 1103 } | 1104 } |
| 1104 | 1105 |
| 1105 #if defined(USE_NSS_CERTS) | 1106 #if defined(USE_NSS_CERTS) |
| 1106 class SSLUITestWithClientCert : public SSLUITest { | 1107 class SSLUITestWithClientCert : public SSLUITest { |
| 1107 public: | 1108 public: |
| 1108 SSLUITestWithClientCert() : cert_db_(NULL) {} | 1109 SSLUITestWithClientCert() : cert_db_(NULL) {} |
| 1109 | 1110 |
| 1110 void SetUpOnMainThread() override { | 1111 void SetUpOnMainThread() override { |
| 1111 SSLUITest::SetUpOnMainThread(); | 1112 SSLUITest::SetUpOnMainThread(); |
| 1112 | 1113 |
| 1113 base::RunLoop loop; | 1114 base::RunLoop loop; |
| 1114 GetNSSCertDatabaseForProfile( | 1115 GetNSSCertDatabaseForProfile( |
| 1115 browser()->profile(), | 1116 browser()->profile(), |
| 1116 base::Bind(&SSLUITestWithClientCert::DidGetCertDatabase, | 1117 base::Bind(&SSLUITestWithClientCert::DidGetCertDatabase, |
| 1117 base::Unretained(this), | 1118 base::Unretained(this), |
| 1118 &loop)); | 1119 &loop)); |
| 1119 loop.Run(); | 1120 loop.Run(); |
| 1120 } | 1121 } |
| 1121 | 1122 |
| 1122 protected: | 1123 protected: |
| 1123 void DidGetCertDatabase(base::RunLoop* loop, net::NSSCertDatabase* cert_db) { | 1124 void DidGetCertDatabase(base::RunLoop* loop, net::NSSCertDatabase* cert_db) { |
| 1124 cert_db_ = cert_db; | 1125 cert_db_ = cert_db; |
| 1125 loop->Quit(); | 1126 loop->Quit(); |
| 1126 } | 1127 } |
| 1127 | 1128 |
| 1128 net::NSSCertDatabase* cert_db_; | 1129 net::NSSCertDatabase* cert_db_; |
| 1129 }; | 1130 }; |
| 1130 | 1131 |
| 1131 // SSL client certificate tests are only enabled when using NSS for private key | 1132 // SSL client certificate tests are only enabled when using NSS for private key |
| 1132 // storage, as only NSS can avoid modifying global machine state when testing. | 1133 // storage, as only NSS can avoid modifying global machine state when testing. |
| 1133 // See http://crbug.com/51132 | 1134 // See http://crbug.com/51132 |
| 1134 | 1135 |
| 1135 // Visit a HTTPS page which requires client cert authentication. The client | 1136 // Visit a HTTPS page which requires client cert authentication. The client |
| 1136 // cert will be selected automatically, then a test which uses WebSocket runs. | 1137 // cert will be selected automatically, then a test which uses WebSocket runs. |
| 1137 IN_PROC_BROWSER_TEST_F(SSLUITestWithClientCert, TestWSSClientCert) { | 1138 IN_PROC_BROWSER_TEST_F(SSLUITestWithClientCert, TestWSSClientCert) { |
| 1138 // Import a client cert for test. | 1139 // Import a client cert for test. |
| (...skipping 1767 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2906 | 2907 |
| 2907 // Visit a page over https that contains a frame with a redirect. | 2908 // Visit a page over https that contains a frame with a redirect. |
| 2908 | 2909 |
| 2909 // XMLHttpRequest insecure content in synchronous mode. | 2910 // XMLHttpRequest insecure content in synchronous mode. |
| 2910 | 2911 |
| 2911 // XMLHttpRequest insecure content in asynchronous mode. | 2912 // XMLHttpRequest insecure content in asynchronous mode. |
| 2912 | 2913 |
| 2913 // XMLHttpRequest over bad ssl in synchronous mode. | 2914 // XMLHttpRequest over bad ssl in synchronous mode. |
| 2914 | 2915 |
| 2915 // XMLHttpRequest over OK ssl in synchronous mode. | 2916 // XMLHttpRequest over OK ssl in synchronous mode. |
| OLD | NEW |