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/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
11 #include "base/strings/utf_string_conversions.h" | 11 #include "base/strings/utf_string_conversions.h" |
12 #include "base/time/time.h" | 12 #include "base/time/time.h" |
13 #include "chrome/app/chrome_command_ids.h" | 13 #include "chrome/app/chrome_command_ids.h" |
| 14 #include "chrome/browser/browser_process.h" |
14 #include "chrome/browser/chrome_notification_types.h" | 15 #include "chrome/browser/chrome_notification_types.h" |
| 16 #include "chrome/browser/net/certificate_error_reporter.h" |
15 #include "chrome/browser/profiles/profile.h" | 17 #include "chrome/browser/profiles/profile.h" |
| 18 #include "chrome/browser/safe_browsing/ping_manager.h" |
| 19 #include "chrome/browser/safe_browsing/safe_browsing_service.h" |
16 #include "chrome/browser/ssl/ssl_blocking_page.h" | 20 #include "chrome/browser/ssl/ssl_blocking_page.h" |
17 #include "chrome/browser/ui/browser.h" | 21 #include "chrome/browser/ui/browser.h" |
18 #include "chrome/browser/ui/browser_commands.h" | 22 #include "chrome/browser/ui/browser_commands.h" |
19 #include "chrome/browser/ui/browser_navigator.h" | 23 #include "chrome/browser/ui/browser_navigator.h" |
20 #include "chrome/browser/ui/browser_tabstrip.h" | 24 #include "chrome/browser/ui/browser_tabstrip.h" |
21 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 25 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
22 #include "chrome/common/chrome_paths.h" | 26 #include "chrome/common/chrome_paths.h" |
23 #include "chrome/common/chrome_switches.h" | 27 #include "chrome/common/chrome_switches.h" |
24 #include "chrome/common/pref_names.h" | 28 #include "chrome/common/pref_names.h" |
25 #include "chrome/test/base/in_process_browser_test.h" | 29 #include "chrome/test/base/in_process_browser_test.h" |
(...skipping 12 matching lines...) Expand all Loading... |
38 #include "content/public/browser/web_contents_observer.h" | 42 #include "content/public/browser/web_contents_observer.h" |
39 #include "content/public/common/security_style.h" | 43 #include "content/public/common/security_style.h" |
40 #include "content/public/common/ssl_status.h" | 44 #include "content/public/common/ssl_status.h" |
41 #include "content/public/test/browser_test_utils.h" | 45 #include "content/public/test/browser_test_utils.h" |
42 #include "content/public/test/download_test_observer.h" | 46 #include "content/public/test/download_test_observer.h" |
43 #include "content/public/test/test_renderer_host.h" | 47 #include "content/public/test/test_renderer_host.h" |
44 #include "net/base/net_errors.h" | 48 #include "net/base/net_errors.h" |
45 #include "net/base/test_data_directory.h" | 49 #include "net/base/test_data_directory.h" |
46 #include "net/cert/cert_status_flags.h" | 50 #include "net/cert/cert_status_flags.h" |
47 #include "net/test/spawned_test_server/spawned_test_server.h" | 51 #include "net/test/spawned_test_server/spawned_test_server.h" |
| 52 #include "net/url_request/url_request_context.h" |
48 | 53 |
49 #if defined(USE_NSS) | 54 #if defined(USE_NSS) |
50 #include "chrome/browser/net/nss_context.h" | 55 #include "chrome/browser/net/nss_context.h" |
51 #include "net/base/crypto_module.h" | 56 #include "net/base/crypto_module.h" |
52 #include "net/cert/nss_cert_database.h" | 57 #include "net/cert/nss_cert_database.h" |
53 #endif // defined(USE_NSS) | 58 #endif // defined(USE_NSS) |
54 | 59 |
55 using base::ASCIIToUTF16; | 60 using base::ASCIIToUTF16; |
| 61 using chrome_browser_net::CertificateErrorReporter; |
56 using content::InterstitialPage; | 62 using content::InterstitialPage; |
57 using content::NavigationController; | 63 using content::NavigationController; |
58 using content::NavigationEntry; | 64 using content::NavigationEntry; |
59 using content::SSLStatus; | 65 using content::SSLStatus; |
60 using content::WebContents; | 66 using content::WebContents; |
61 using web_modal::WebContentsModalDialogManager; | 67 using web_modal::WebContentsModalDialogManager; |
62 | 68 |
63 const base::FilePath::CharType kDocRoot[] = | 69 const base::FilePath::CharType kDocRoot[] = |
64 FILE_PATH_LITERAL("chrome/test/data"); | 70 FILE_PATH_LITERAL("chrome/test/data"); |
65 | 71 |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 content::SecurityStyle expected_security_style, | 168 content::SecurityStyle expected_security_style, |
163 int expected_authentication_state) { | 169 int expected_authentication_state) { |
164 ASSERT_FALSE(tab->IsCrashed()); | 170 ASSERT_FALSE(tab->IsCrashed()); |
165 NavigationEntry* entry = tab->GetController().GetActiveEntry(); | 171 NavigationEntry* entry = tab->GetController().GetActiveEntry(); |
166 ASSERT_TRUE(entry); | 172 ASSERT_TRUE(entry); |
167 CertError::Check(*entry, error); | 173 CertError::Check(*entry, error); |
168 SecurityStyle::Check(*entry, expected_security_style); | 174 SecurityStyle::Check(*entry, expected_security_style); |
169 AuthState::Check(*entry, expected_authentication_state); | 175 AuthState::Check(*entry, expected_authentication_state); |
170 } | 176 } |
171 | 177 |
| 178 namespace CertificateReporting { |
| 179 |
| 180 enum OptIn { EXTENDED_REPORTING_OPT_IN, EXTENDED_REPORTING_DO_NOT_OPT_IN }; |
| 181 |
| 182 enum Proceed { SSL_INTERSTITIAL_PROCEED, SSL_INTERSTITIAL_DO_NOT_PROCEED }; |
| 183 |
| 184 enum ExpectReport { CERT_REPORT_EXPECTED, CERT_REPORT_NOT_EXPECTED }; |
| 185 |
| 186 // This class is used to test invalid certificate chain reporting when |
| 187 // the user opts in to do so on the interstitial. |
| 188 class MockReporter : public CertificateErrorReporter { |
| 189 public: |
| 190 explicit MockReporter(net::URLRequestContext* request_context, |
| 191 const GURL& upload_url, |
| 192 CookiesPreference cookies_preference) |
| 193 : CertificateErrorReporter(request_context, |
| 194 upload_url, |
| 195 cookies_preference) {} |
| 196 |
| 197 void SendReport(CertificateErrorReporter::ReportType type, |
| 198 const std::string& hostname, |
| 199 const net::SSLInfo& ssl_info) override { |
| 200 EXPECT_EQ(CertificateErrorReporter::REPORT_TYPE_EXTENDED_REPORTING, type); |
| 201 latest_hostname_reported_ = hostname; |
| 202 } |
| 203 |
| 204 const std::string& latest_hostname_reported() { |
| 205 return latest_hostname_reported_; |
| 206 } |
| 207 |
| 208 private: |
| 209 std::string latest_hostname_reported_; |
| 210 }; |
| 211 |
| 212 void SetUpMockReporter(SafeBrowsingService* safe_browsing_service, |
| 213 MockReporter* reporter) { |
| 214 safe_browsing_service->ping_manager()->SetCertificateErrorReporterForTesting( |
| 215 scoped_ptr<CertificateErrorReporter>(reporter)); |
| 216 } |
| 217 |
| 218 } // namespace CertificateReporting |
| 219 |
172 } // namespace | 220 } // namespace |
173 | 221 |
174 class SSLUITest : public InProcessBrowserTest { | 222 class SSLUITest : public InProcessBrowserTest { |
175 public: | 223 public: |
176 SSLUITest() | 224 SSLUITest() |
177 : https_server_(net::SpawnedTestServer::TYPE_HTTPS, | 225 : https_server_(net::SpawnedTestServer::TYPE_HTTPS, |
178 SSLOptions(SSLOptions::CERT_OK), | 226 SSLOptions(SSLOptions::CERT_OK), |
179 base::FilePath(kDocRoot)), | 227 base::FilePath(kDocRoot)), |
180 https_server_expired_(net::SpawnedTestServer::TYPE_HTTPS, | 228 https_server_expired_(net::SpawnedTestServer::TYPE_HTTPS, |
181 SSLOptions(SSLOptions::CERT_EXPIRED), | 229 SSLOptions(SSLOptions::CERT_EXPIRED), |
182 base::FilePath(kDocRoot)), | 230 base::FilePath(kDocRoot)), |
183 https_server_mismatched_(net::SpawnedTestServer::TYPE_HTTPS, | 231 https_server_mismatched_(net::SpawnedTestServer::TYPE_HTTPS, |
184 SSLOptions(SSLOptions::CERT_MISMATCHED_NAME), | 232 SSLOptions(SSLOptions::CERT_MISMATCHED_NAME), |
185 base::FilePath(kDocRoot)), | 233 base::FilePath(kDocRoot)), |
186 wss_server_expired_(net::SpawnedTestServer::TYPE_WSS, | 234 wss_server_expired_(net::SpawnedTestServer::TYPE_WSS, |
187 SSLOptions(SSLOptions::CERT_EXPIRED), | 235 SSLOptions(SSLOptions::CERT_EXPIRED), |
188 net::GetWebSocketTestDataDirectory()) {} | 236 net::GetWebSocketTestDataDirectory()) {} |
189 | 237 |
| 238 void SetUpOnMainThread() override { |
| 239 // Set up the mock reporter to track the hostnames that reports get |
| 240 // sent for. The request_context argument is NULL here |
| 241 // because the MockReporter doesn't actually use a |
| 242 // request_context. (In order to pass a real request_context, the |
| 243 // reporter would have to be constructed on the IO thread.) |
| 244 reporter_ = new CertificateReporting::MockReporter( |
| 245 NULL, GURL("http://example.test"), |
| 246 CertificateReporting::MockReporter::DO_NOT_SEND_COOKIES); |
| 247 scoped_refptr<SafeBrowsingService> safe_browsing_service = |
| 248 g_browser_process->safe_browsing_service(); |
| 249 ASSERT_TRUE(safe_browsing_service); |
| 250 content::BrowserThread::PostTask( |
| 251 content::BrowserThread::IO, FROM_HERE, |
| 252 base::Bind(CertificateReporting::SetUpMockReporter, |
| 253 safe_browsing_service, reporter_)); |
| 254 } |
| 255 |
190 void SetUpCommandLine(base::CommandLine* command_line) override { | 256 void SetUpCommandLine(base::CommandLine* command_line) override { |
191 // Browser will both run and display insecure content. | 257 // Browser will both run and display insecure content. |
192 command_line->AppendSwitch(switches::kAllowRunningInsecureContent); | 258 command_line->AppendSwitch(switches::kAllowRunningInsecureContent); |
193 // Use process-per-site so that navigating to a same-site page in a | 259 // Use process-per-site so that navigating to a same-site page in a |
194 // new tab will use the same process. | 260 // new tab will use the same process. |
195 command_line->AppendSwitch(switches::kProcessPerSite); | 261 command_line->AppendSwitch(switches::kProcessPerSite); |
196 } | 262 } |
197 | 263 |
198 void CheckAuthenticatedState(WebContents* tab, | 264 void CheckAuthenticatedState(WebContents* tab, |
199 int expected_authentication_state) { | 265 int expected_authentication_state) { |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
344 std::vector<net::SpawnedTestServer::StringPair> | 410 std::vector<net::SpawnedTestServer::StringPair> |
345 replacement_text_for_page_with_unsafe_worker; | 411 replacement_text_for_page_with_unsafe_worker; |
346 replacement_text_for_page_with_unsafe_worker.push_back( | 412 replacement_text_for_page_with_unsafe_worker.push_back( |
347 make_pair("REPLACE_WITH_UNSAFE_WORKER_PATH", unsafe_worker_path)); | 413 make_pair("REPLACE_WITH_UNSAFE_WORKER_PATH", unsafe_worker_path)); |
348 return net::SpawnedTestServer::GetFilePathWithReplacements( | 414 return net::SpawnedTestServer::GetFilePathWithReplacements( |
349 "files/ssl/page_with_unsafe_worker.html", | 415 "files/ssl/page_with_unsafe_worker.html", |
350 replacement_text_for_page_with_unsafe_worker, | 416 replacement_text_for_page_with_unsafe_worker, |
351 page_with_unsafe_worker_path); | 417 page_with_unsafe_worker_path); |
352 } | 418 } |
353 | 419 |
| 420 // Helper function for testing invalid certificate chain reporting. |
| 421 void TestBrokenHTTPSReporting( |
| 422 CertificateReporting::OptIn opt_in, |
| 423 CertificateReporting::Proceed proceed, |
| 424 CertificateReporting::ExpectReport expect_report, |
| 425 Browser* browser) { |
| 426 ASSERT_TRUE(https_server_expired_.Start()); |
| 427 |
| 428 // Opt in to sending reports for invalid certificate chains. |
| 429 browser->profile()->GetPrefs()->SetBoolean( |
| 430 prefs::kSafeBrowsingExtendedReportingEnabled, |
| 431 opt_in == CertificateReporting::EXTENDED_REPORTING_OPT_IN); |
| 432 |
| 433 ui_test_utils::NavigateToURL(browser, https_server_expired_.GetURL("/")); |
| 434 |
| 435 WebContents* tab = browser->tab_strip_model()->GetActiveWebContents(); |
| 436 CheckAuthenticationBrokenState(tab, net::CERT_STATUS_DATE_INVALID, |
| 437 AuthState::SHOWING_INTERSTITIAL); |
| 438 |
| 439 // Set up a callback so that the test is notified when the report |
| 440 // has been sent on the IO thread (or not sent). |
| 441 base::RunLoop report_run_loop; |
| 442 base::Closure report_callback = report_run_loop.QuitClosure(); |
| 443 SSLBlockingPage* interstitial_page = static_cast<SSLBlockingPage*>( |
| 444 tab->GetInterstitialPage()->GetDelegateForTesting()); |
| 445 interstitial_page->SetCertificateReportCallbackForTesting(report_callback); |
| 446 |
| 447 EXPECT_EQ(std::string(), reporter_->latest_hostname_reported()); |
| 448 |
| 449 // Leave the interstitial (either by proceeding or going back) |
| 450 if (proceed == CertificateReporting::SSL_INTERSTITIAL_PROCEED) { |
| 451 ProceedThroughInterstitial(tab); |
| 452 } else { |
| 453 // Click "Take me back" |
| 454 InterstitialPage* interstitial_page = tab->GetInterstitialPage(); |
| 455 ASSERT_TRUE(interstitial_page); |
| 456 interstitial_page->DontProceed(); |
| 457 } |
| 458 |
| 459 // Wait until the report has been sent on the IO thread. |
| 460 report_run_loop.Run(); |
| 461 |
| 462 if (expect_report == CertificateReporting::CERT_REPORT_EXPECTED) { |
| 463 // Check that the mock reporter received a request to send a report. |
| 464 EXPECT_EQ(https_server_expired_.GetURL("/").host(), |
| 465 reporter_->latest_hostname_reported()); |
| 466 } else { |
| 467 EXPECT_EQ(std::string(), reporter_->latest_hostname_reported()); |
| 468 } |
| 469 } |
| 470 |
354 net::SpawnedTestServer https_server_; | 471 net::SpawnedTestServer https_server_; |
355 net::SpawnedTestServer https_server_expired_; | 472 net::SpawnedTestServer https_server_expired_; |
356 net::SpawnedTestServer https_server_mismatched_; | 473 net::SpawnedTestServer https_server_mismatched_; |
357 net::SpawnedTestServer wss_server_expired_; | 474 net::SpawnedTestServer wss_server_expired_; |
358 | 475 |
359 private: | 476 private: |
360 typedef net::SpawnedTestServer::SSLOptions SSLOptions; | 477 typedef net::SpawnedTestServer::SSLOptions SSLOptions; |
| 478 CertificateReporting::MockReporter* reporter_; |
361 | 479 |
362 DISALLOW_COPY_AND_ASSIGN(SSLUITest); | 480 DISALLOW_COPY_AND_ASSIGN(SSLUITest); |
363 }; | 481 }; |
364 | 482 |
365 class SSLUITestBlock : public SSLUITest { | 483 class SSLUITestBlock : public SSLUITest { |
366 public: | 484 public: |
367 SSLUITestBlock() : SSLUITest() {} | 485 SSLUITestBlock() : SSLUITest() {} |
368 | 486 |
369 // Browser will neither run nor display insecure content. | 487 // Browser will neither run nor display insecure content. |
370 void SetUpCommandLine(base::CommandLine* command_line) override { | 488 void SetUpCommandLine(base::CommandLine* command_line) override { |
(...skipping 14 matching lines...) Expand all Loading... |
385 class SSLUITestIgnoreLocalhostCertErrors : public SSLUITest { | 503 class SSLUITestIgnoreLocalhostCertErrors : public SSLUITest { |
386 public: | 504 public: |
387 SSLUITestIgnoreLocalhostCertErrors() : SSLUITest() {} | 505 SSLUITestIgnoreLocalhostCertErrors() : SSLUITest() {} |
388 | 506 |
389 void SetUpCommandLine(base::CommandLine* command_line) override { | 507 void SetUpCommandLine(base::CommandLine* command_line) override { |
390 // Browser will ignore certificate errors on localhost. | 508 // Browser will ignore certificate errors on localhost. |
391 command_line->AppendSwitch(switches::kAllowInsecureLocalhost); | 509 command_line->AppendSwitch(switches::kAllowInsecureLocalhost); |
392 } | 510 } |
393 }; | 511 }; |
394 | 512 |
| 513 class SSLUITestWithExtendedReporting : public SSLUITest { |
| 514 public: |
| 515 SSLUITestWithExtendedReporting() : SSLUITest() {} |
| 516 |
| 517 void SetUpCommandLine(base::CommandLine* command_line) override { |
| 518 // Enable a checkbox on SSL interstitials that allows users to opt |
| 519 // in to reporting invalid certificate chains. |
| 520 command_line->AppendSwitch(switches::kEnableInvalidCertCollection); |
| 521 } |
| 522 }; |
| 523 |
395 // Visits a regular page over http. | 524 // Visits a regular page over http. |
396 IN_PROC_BROWSER_TEST_F(SSLUITest, TestHTTP) { | 525 IN_PROC_BROWSER_TEST_F(SSLUITest, TestHTTP) { |
397 ASSERT_TRUE(test_server()->Start()); | 526 ASSERT_TRUE(test_server()->Start()); |
398 | 527 |
399 ui_test_utils::NavigateToURL(browser(), | 528 ui_test_utils::NavigateToURL(browser(), |
400 test_server()->GetURL("files/ssl/google.html")); | 529 test_server()->GetURL("files/ssl/google.html")); |
401 | 530 |
402 CheckUnauthenticatedState( | 531 CheckUnauthenticatedState( |
403 browser()->tab_strip_model()->GetActiveWebContents(), AuthState::NONE); | 532 browser()->tab_strip_model()->GetActiveWebContents(), AuthState::NONE); |
404 } | 533 } |
(...skipping 577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
982 &replacement_path)); | 1111 &replacement_path)); |
983 | 1112 |
984 // Load a page that displays insecure content. | 1113 // Load a page that displays insecure content. |
985 ui_test_utils::NavigateToURL(browser(), | 1114 ui_test_utils::NavigateToURL(browser(), |
986 https_server_.GetURL(replacement_path)); | 1115 https_server_.GetURL(replacement_path)); |
987 | 1116 |
988 CheckAuthenticatedState(browser()->tab_strip_model()->GetActiveWebContents(), | 1117 CheckAuthenticatedState(browser()->tab_strip_model()->GetActiveWebContents(), |
989 AuthState::DISPLAYED_INSECURE_CONTENT); | 1118 AuthState::DISPLAYED_INSECURE_CONTENT); |
990 } | 1119 } |
991 | 1120 |
| 1121 // Test that when the checkbox is checked and the user proceeds through |
| 1122 // the interstitial, the FraudulentCertificateReporter sees a request to |
| 1123 // send a report. |
| 1124 IN_PROC_BROWSER_TEST_F(SSLUITestWithExtendedReporting, |
| 1125 TestBrokenHTTPSProceedWithReporting) { |
| 1126 TestBrokenHTTPSReporting(CertificateReporting::EXTENDED_REPORTING_OPT_IN, |
| 1127 CertificateReporting::SSL_INTERSTITIAL_PROCEED, |
| 1128 CertificateReporting::CERT_REPORT_EXPECTED, |
| 1129 browser()); |
| 1130 } |
| 1131 |
| 1132 // Test that when the checkbox is checked and the user goes back (does |
| 1133 // not proceed through the interstitial), the |
| 1134 // FraudulentCertificateReporter sees a request to send a report. |
| 1135 IN_PROC_BROWSER_TEST_F(SSLUITestWithExtendedReporting, |
| 1136 TestBrokenHTTPSGoBackWithReporting) { |
| 1137 TestBrokenHTTPSReporting( |
| 1138 CertificateReporting::EXTENDED_REPORTING_OPT_IN, |
| 1139 CertificateReporting::SSL_INTERSTITIAL_DO_NOT_PROCEED, |
| 1140 CertificateReporting::CERT_REPORT_EXPECTED, browser()); |
| 1141 } |
| 1142 |
| 1143 // Test that when the checkbox is not checked and the user proceeds |
| 1144 // through the interstitial, the FraudulentCertificateReporter does not |
| 1145 // see a request to send a report. |
| 1146 IN_PROC_BROWSER_TEST_F(SSLUITestWithExtendedReporting, |
| 1147 TestBrokenHTTPSProceedWithNoReporting) { |
| 1148 TestBrokenHTTPSReporting( |
| 1149 CertificateReporting::EXTENDED_REPORTING_DO_NOT_OPT_IN, |
| 1150 CertificateReporting::SSL_INTERSTITIAL_PROCEED, |
| 1151 CertificateReporting::CERT_REPORT_NOT_EXPECTED, browser()); |
| 1152 } |
| 1153 |
| 1154 // Test that when the checkbox is not checked and the user does not proceed |
| 1155 // through the interstitial, the FraudulentCertificateReporter does not |
| 1156 // see a request to send a report. |
| 1157 IN_PROC_BROWSER_TEST_F(SSLUITestWithExtendedReporting, |
| 1158 TestBrokenHTTPSGoBackWithNoReporting) { |
| 1159 TestBrokenHTTPSReporting( |
| 1160 CertificateReporting::EXTENDED_REPORTING_DO_NOT_OPT_IN, |
| 1161 CertificateReporting::SSL_INTERSTITIAL_DO_NOT_PROCEED, |
| 1162 CertificateReporting::CERT_REPORT_NOT_EXPECTED, browser()); |
| 1163 } |
| 1164 |
| 1165 // Test that when the command-line switch for reporting invalid cert |
| 1166 // chains is not enabled, reports don't get sent, even if the opt-in |
| 1167 // preference is set. (i.e. if a user enables invalid cert collection in |
| 1168 // chrome://flags, checks the box on an interstitial, and then disables |
| 1169 // the flag in chrome://flags, reports shouldn't be sent on the next |
| 1170 // interstitial). |
| 1171 IN_PROC_BROWSER_TEST_F(SSLUITest, TestBrokenHTTPSNoReportingWithoutSwitch) { |
| 1172 TestBrokenHTTPSReporting(CertificateReporting::EXTENDED_REPORTING_OPT_IN, |
| 1173 CertificateReporting::SSL_INTERSTITIAL_PROCEED, |
| 1174 CertificateReporting::CERT_REPORT_NOT_EXPECTED, |
| 1175 browser()); |
| 1176 } |
| 1177 |
| 1178 // Test that reports don't get sent in incognito mode even if the opt-in |
| 1179 // preference is set and the command-line switch is enabled. |
| 1180 IN_PROC_BROWSER_TEST_F(SSLUITestWithExtendedReporting, |
| 1181 TestBrokenHTTPSNoReportingInIncognito) { |
| 1182 TestBrokenHTTPSReporting(CertificateReporting::EXTENDED_REPORTING_OPT_IN, |
| 1183 CertificateReporting::SSL_INTERSTITIAL_PROCEED, |
| 1184 CertificateReporting::CERT_REPORT_NOT_EXPECTED, |
| 1185 CreateIncognitoBrowser()); |
| 1186 } |
| 1187 |
992 // Visits a page that runs insecure content and tries to suppress the insecure | 1188 // Visits a page that runs insecure content and tries to suppress the insecure |
993 // content warnings by randomizing location.hash. | 1189 // content warnings by randomizing location.hash. |
994 // Based on http://crbug.com/8706 | 1190 // Based on http://crbug.com/8706 |
995 IN_PROC_BROWSER_TEST_F(SSLUITest, | 1191 IN_PROC_BROWSER_TEST_F(SSLUITest, |
996 TestRunsInsecuredContentRandomizeHash) { | 1192 TestRunsInsecuredContentRandomizeHash) { |
997 ASSERT_TRUE(test_server()->Start()); | 1193 ASSERT_TRUE(test_server()->Start()); |
998 ASSERT_TRUE(https_server_.Start()); | 1194 ASSERT_TRUE(https_server_.Start()); |
999 | 1195 |
1000 ui_test_utils::NavigateToURL(browser(), https_server_.GetURL( | 1196 ui_test_utils::NavigateToURL(browser(), https_server_.GetURL( |
1001 "files/ssl/page_runs_insecure_content.html")); | 1197 "files/ssl/page_runs_insecure_content.html")); |
(...skipping 930 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1932 | 2128 |
1933 // Visit a page over https that contains a frame with a redirect. | 2129 // Visit a page over https that contains a frame with a redirect. |
1934 | 2130 |
1935 // XMLHttpRequest insecure content in synchronous mode. | 2131 // XMLHttpRequest insecure content in synchronous mode. |
1936 | 2132 |
1937 // XMLHttpRequest insecure content in asynchronous mode. | 2133 // XMLHttpRequest insecure content in asynchronous mode. |
1938 | 2134 |
1939 // XMLHttpRequest over bad ssl in synchronous mode. | 2135 // XMLHttpRequest over bad ssl in synchronous mode. |
1940 | 2136 |
1941 // XMLHttpRequest over OK ssl in synchronous mode. | 2137 // XMLHttpRequest over OK ssl in synchronous mode. |
OLD | NEW |