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

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

Issue 2964283002: Add chrome channel to cert logger reports (Closed)
Patch Set: Add browser test to test end to end cert report workflow 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 563 matching lines...) Expand 10 before | Expand all | Expand 10 after
574 expect_report); 574 expect_report);
575 575
576 ASSERT_TRUE(tab->GetInterstitialPage() != nullptr); 576 ASSERT_TRUE(tab->GetInterstitialPage() != nullptr);
577 SSLBlockingPage* interstitial_page = static_cast<SSLBlockingPage*>( 577 SSLBlockingPage* interstitial_page = static_cast<SSLBlockingPage*>(
578 tab->GetInterstitialPage()->GetDelegateForTesting()); 578 tab->GetInterstitialPage()->GetDelegateForTesting());
579 ASSERT_TRUE(interstitial_page != nullptr); 579 ASSERT_TRUE(interstitial_page != nullptr);
580 interstitial_page->SetSSLCertReporterForTesting( 580 interstitial_page->SetSSLCertReporterForTesting(
581 std::move(ssl_cert_reporter)); 581 std::move(ssl_cert_reporter));
582 582
583 EXPECT_EQ(std::string(), reporter_callback.GetLatestHostnameReported()); 583 EXPECT_EQ(std::string(), reporter_callback.GetLatestHostnameReported());
584 EXPECT_EQ(certificate_reporting::CertLoggerRequest::CHROME_CHANNEL_NONE,
estark 2017/07/10 20:43:01 Does this pass? I'd expect it to be CHROME_CHANNEL
sperigo 2017/07/10 22:43:23 It does! Mustafa and I spent some time designing t
estark 2017/07/10 23:03:19 Ohh, I see; I actually meant to put this comment o
585 reporter_callback.GetLatestChromeChannelReported());
584 586
585 // Leave the interstitial (either by proceeding or going back) 587 // Leave the interstitial (either by proceeding or going back)
586 if (proceed == SSL_INTERSTITIAL_PROCEED) { 588 if (proceed == SSL_INTERSTITIAL_PROCEED) {
587 ProceedThroughInterstitial(tab); 589 ProceedThroughInterstitial(tab);
588 } else { 590 } else {
589 // Click "Take me back" 591 // Click "Take me back"
590 InterstitialPage* interstitial_page = tab->GetInterstitialPage(); 592 InterstitialPage* interstitial_page = tab->GetInterstitialPage();
591 ASSERT_TRUE(interstitial_page); 593 ASSERT_TRUE(interstitial_page);
592 interstitial_page->DontProceed(); 594 interstitial_page->DontProceed();
593 } 595 }
594 596
595 if (expect_report == 597 if (expect_report ==
596 certificate_reporting_test_utils::CERT_REPORT_EXPECTED) { 598 certificate_reporting_test_utils::CERT_REPORT_EXPECTED) {
597 // Check that the mock reporter received a request to send a report. 599 // Check that the mock reporter received a request to send a report.
598 run_loop.Run(); 600 run_loop.Run();
599 EXPECT_EQ(https_server_expired_.GetURL("/title1.html").host(), 601 EXPECT_EQ(https_server_expired_.GetURL("/title1.html").host(),
600 reporter_callback.GetLatestHostnameReported()); 602 reporter_callback.GetLatestHostnameReported());
603 EXPECT_NE(certificate_reporting::CertLoggerRequest::CHROME_CHANNEL_NONE,
604 reporter_callback.GetLatestChromeChannelReported());
601 } else { 605 } else {
602 base::RunLoop().RunUntilIdle(); 606 base::RunLoop().RunUntilIdle();
603 EXPECT_EQ(std::string(), reporter_callback.GetLatestHostnameReported()); 607 EXPECT_EQ(std::string(), reporter_callback.GetLatestHostnameReported());
608 EXPECT_EQ(certificate_reporting::CertLoggerRequest::CHROME_CHANNEL_NONE,
609 reporter_callback.GetLatestChromeChannelReported());
604 } 610 }
605 } 611 }
606 612
607 // Helper function for testing invalid certificate chain reporting with the 613 // Helper function for testing invalid certificate chain reporting with the
608 // bad clock interstitial. 614 // bad clock interstitial.
609 void TestBadClockReporting( 615 void TestBadClockReporting(
610 certificate_reporting_test_utils::OptIn opt_in, 616 certificate_reporting_test_utils::OptIn opt_in,
611 certificate_reporting_test_utils::ExpectReport expect_report, 617 certificate_reporting_test_utils::ExpectReport expect_report,
612 Browser* browser) { 618 Browser* browser) {
613 ASSERT_TRUE(https_server_expired_.Start()); 619 ASSERT_TRUE(https_server_expired_.Start());
(...skipping 4332 matching lines...) Expand 10 before | Expand all | Expand 10 after
4946 4952
4947 // Visit a page over https that contains a frame with a redirect. 4953 // Visit a page over https that contains a frame with a redirect.
4948 4954
4949 // XMLHttpRequest insecure content in synchronous mode. 4955 // XMLHttpRequest insecure content in synchronous mode.
4950 4956
4951 // XMLHttpRequest insecure content in asynchronous mode. 4957 // XMLHttpRequest insecure content in asynchronous mode.
4952 4958
4953 // XMLHttpRequest over bad ssl in synchronous mode. 4959 // XMLHttpRequest over bad ssl in synchronous mode.
4954 4960
4955 // XMLHttpRequest over OK ssl in synchronous mode. 4961 // 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/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698