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

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

Issue 2540853005: Test interstitials shouldn't use null SSLCertReporters (Closed)
Patch Set: Fix the checks Created 4 years 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
« no previous file with comments | « no previous file | chrome/browser/ssl/cert_report_helper.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "chrome/browser/ssl/captive_portal_blocking_page.h" 5 #include "chrome/browser/ssl/captive_portal_blocking_page.h"
6 6
7 #include <string> 7 #include <string>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 TestCertReporting( 313 TestCertReporting(
314 certificate_reporting_test_utils::EXTENDED_REPORTING_OPT_IN); 314 certificate_reporting_test_utils::EXTENDED_REPORTING_OPT_IN);
315 } 315 }
316 } 316 }
317 317
318 IN_PROC_BROWSER_TEST_F(CaptivePortalBlockingPageTest, CertReportingOptOut) { 318 IN_PROC_BROWSER_TEST_F(CaptivePortalBlockingPageTest, CertReportingOptOut) {
319 TestCertReporting( 319 TestCertReporting(
320 certificate_reporting_test_utils::EXTENDED_REPORTING_DO_NOT_OPT_IN); 320 certificate_reporting_test_utils::EXTENDED_REPORTING_DO_NOT_OPT_IN);
321 } 321 }
322 322
323 class FakeSSLCertReporter : public SSLCertReporter {
324 public:
325 // SSLCertReporter methods:
326 void ReportInvalidCertificateChain(
327 const std::string& serialized_report) override {}
328 };
329
323 class CaptivePortalBlockingPageIDNTest : public SecurityInterstitialIDNTest { 330 class CaptivePortalBlockingPageIDNTest : public SecurityInterstitialIDNTest {
324 protected: 331 protected:
325 // SecurityInterstitialIDNTest implementation 332 // SecurityInterstitialIDNTest implementation
326 SecurityInterstitialPage* CreateInterstitial( 333 SecurityInterstitialPage* CreateInterstitial(
327 content::WebContents* contents, 334 content::WebContents* contents,
328 const GURL& request_url) const override { 335 const GURL& request_url) const override {
329 net::SSLInfo empty_ssl_info; 336 net::SSLInfo empty_ssl_info;
330 // Blocking page is owned by the interstitial. 337 // Blocking page is owned by the interstitial.
331 CaptivePortalBlockingPage* blocking_page = 338 CaptivePortalBlockingPage* blocking_page =
332 new CaptivePortalBlockingPageForTesting( 339 new CaptivePortalBlockingPageForTesting(
333 contents, GURL(kBrokenSSL), request_url, nullptr, empty_ssl_info, 340 contents, GURL(kBrokenSSL), request_url,
341 std::unique_ptr<SSLCertReporter>(new FakeSSLCertReporter()),
342 empty_ssl_info,
334 base::Callback<void(content::CertificateRequestResultType)>(), 343 base::Callback<void(content::CertificateRequestResultType)>(),
335 false, ""); 344 false, "");
336 return blocking_page; 345 return blocking_page;
337 } 346 }
338 }; 347 };
339 348
340 // Test that an IDN login domain is decoded properly. 349 // Test that an IDN login domain is decoded properly.
341 IN_PROC_BROWSER_TEST_F(CaptivePortalBlockingPageIDNTest, 350 IN_PROC_BROWSER_TEST_F(CaptivePortalBlockingPageIDNTest,
342 ShowLoginIDNIfPortalRedirectsDetectionURL) { 351 ShowLoginIDNIfPortalRedirectsDetectionURL) {
343 EXPECT_TRUE(VerifyIDNDecoded()); 352 EXPECT_TRUE(VerifyIDNDecoded());
344 } 353 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ssl/cert_report_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698