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

Side by Side Diff: chrome/browser/ssl/ssl_browser_tests.cc

Issue 2964283002: Add chrome channel to cert logger reports (Closed)
Patch Set: Fix build errors Created 3 years, 5 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
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 <utility> 5 #include <utility>
6 6
7 #include "base/base64.h" 7 #include "base/base64.h"
8 #include "base/base_switches.h" 8 #include "base/base_switches.h"
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after
602 expect_report); 602 expect_report);
603 603
604 ASSERT_TRUE(tab->GetInterstitialPage() != nullptr); 604 ASSERT_TRUE(tab->GetInterstitialPage() != nullptr);
605 SSLBlockingPage* interstitial_page = static_cast<SSLBlockingPage*>( 605 SSLBlockingPage* interstitial_page = static_cast<SSLBlockingPage*>(
606 tab->GetInterstitialPage()->GetDelegateForTesting()); 606 tab->GetInterstitialPage()->GetDelegateForTesting());
607 ASSERT_TRUE(interstitial_page != nullptr); 607 ASSERT_TRUE(interstitial_page != nullptr);
608 interstitial_page->SetSSLCertReporterForTesting( 608 interstitial_page->SetSSLCertReporterForTesting(
609 std::move(ssl_cert_reporter)); 609 std::move(ssl_cert_reporter));
610 610
611 EXPECT_EQ(std::string(), reporter_callback.GetLatestHostnameReported()); 611 EXPECT_EQ(std::string(), reporter_callback.GetLatestHostnameReported());
612 EXPECT_EQ(certificate_reporting::CertLoggerRequest::CHROME_CHANNEL_NONE,
613 reporter_callback.GetLatestChromeChannelReported());
612 614
613 // Leave the interstitial (either by proceeding or going back) 615 // Leave the interstitial (either by proceeding or going back)
614 if (proceed == SSL_INTERSTITIAL_PROCEED) { 616 if (proceed == SSL_INTERSTITIAL_PROCEED) {
615 ProceedThroughInterstitial(tab); 617 ProceedThroughInterstitial(tab);
616 } else { 618 } else {
617 // Click "Take me back" 619 // Click "Take me back"
618 InterstitialPage* interstitial_page = tab->GetInterstitialPage(); 620 InterstitialPage* interstitial_page = tab->GetInterstitialPage();
619 ASSERT_TRUE(interstitial_page); 621 ASSERT_TRUE(interstitial_page);
620 interstitial_page->DontProceed(); 622 interstitial_page->DontProceed();
621 } 623 }
622 624
623 if (expect_report == 625 if (expect_report ==
624 certificate_reporting_test_utils::CERT_REPORT_EXPECTED) { 626 certificate_reporting_test_utils::CERT_REPORT_EXPECTED) {
625 // Check that the mock reporter received a request to send a report. 627 // Check that the mock reporter received a request to send a report.
626 run_loop.Run(); 628 run_loop.Run();
627 EXPECT_EQ(https_server_expired_.GetURL("/title1.html").host(), 629 EXPECT_EQ(https_server_expired_.GetURL("/title1.html").host(),
628 reporter_callback.GetLatestHostnameReported()); 630 reporter_callback.GetLatestHostnameReported());
631 EXPECT_NE(certificate_reporting::CertLoggerRequest::CHROME_CHANNEL_NONE,
632 reporter_callback.GetLatestChromeChannelReported());
629 } else { 633 } else {
630 base::RunLoop().RunUntilIdle(); 634 base::RunLoop().RunUntilIdle();
631 EXPECT_EQ(std::string(), reporter_callback.GetLatestHostnameReported()); 635 EXPECT_EQ(std::string(), reporter_callback.GetLatestHostnameReported());
636 EXPECT_EQ(certificate_reporting::CertLoggerRequest::CHROME_CHANNEL_NONE,
637 reporter_callback.GetLatestChromeChannelReported());
632 } 638 }
633 } 639 }
634 640
635 // Helper function for testing invalid certificate chain reporting with the 641 // Helper function for testing invalid certificate chain reporting with the
636 // bad clock interstitial. 642 // bad clock interstitial.
637 void TestBadClockReporting( 643 void TestBadClockReporting(
638 certificate_reporting_test_utils::OptIn opt_in, 644 certificate_reporting_test_utils::OptIn opt_in,
639 certificate_reporting_test_utils::ExpectReport expect_report, 645 certificate_reporting_test_utils::ExpectReport expect_report,
640 Browser* browser) { 646 Browser* browser) {
641 ASSERT_TRUE(https_server_expired_.Start()); 647 ASSERT_TRUE(https_server_expired_.Start());
(...skipping 4472 matching lines...) Expand 10 before | Expand all | Expand 10 after
5114 5120
5115 // Visit a page over https that contains a frame with a redirect. 5121 // Visit a page over https that contains a frame with a redirect.
5116 5122
5117 // XMLHttpRequest insecure content in synchronous mode. 5123 // XMLHttpRequest insecure content in synchronous mode.
5118 5124
5119 // XMLHttpRequest insecure content in asynchronous mode. 5125 // XMLHttpRequest insecure content in asynchronous mode.
5120 5126
5121 // XMLHttpRequest over bad ssl in synchronous mode. 5127 // XMLHttpRequest over bad ssl in synchronous mode.
5122 5128
5123 // XMLHttpRequest over OK ssl in synchronous mode. 5129 // XMLHttpRequest over OK ssl in synchronous mode.
OLDNEW
« no previous file with comments | « chrome/browser/ssl/certificate_reporting_test_utils.cc ('k') | components/certificate_reporting/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698