| OLD | NEW |
| 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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 ExpectWiFiSSID expect_wifi_ssid, | 131 ExpectWiFiSSID expect_wifi_ssid, |
| 132 ExpectLoginURL expect_login_url, | 132 ExpectLoginURL expect_login_url, |
| 133 std::unique_ptr<SSLCertReporter> ssl_cert_reporter, | 133 std::unique_ptr<SSLCertReporter> ssl_cert_reporter, |
| 134 const std::string& expected_login_hostname) { | 134 const std::string& expected_login_hostname) { |
| 135 content::WebContents* contents = | 135 content::WebContents* contents = |
| 136 browser()->tab_strip_model()->GetActiveWebContents(); | 136 browser()->tab_strip_model()->GetActiveWebContents(); |
| 137 DCHECK(contents); | 137 DCHECK(contents); |
| 138 net::SSLInfo ssl_info; | 138 net::SSLInfo ssl_info; |
| 139 ssl_info.cert = | 139 ssl_info.cert = |
| 140 net::ImportCertFromFile(net::GetTestCertsDirectory(), "ok_cert.pem"); | 140 net::ImportCertFromFile(net::GetTestCertsDirectory(), "ok_cert.pem"); |
| 141 ssl_info.cert_status = net::CERT_STATUS_COMMON_NAME_INVALID; |
| 141 // Blocking page is owned by the interstitial. | 142 // Blocking page is owned by the interstitial. |
| 142 CaptivePortalBlockingPage* blocking_page = | 143 CaptivePortalBlockingPage* blocking_page = |
| 143 new CaptivePortalBlockingPageForTesting( | 144 new CaptivePortalBlockingPageForTesting( |
| 144 contents, GURL(kBrokenSSL), login_url, std::move(ssl_cert_reporter), | 145 contents, GURL(kBrokenSSL), login_url, std::move(ssl_cert_reporter), |
| 145 ssl_info, | 146 ssl_info, |
| 146 base::Callback<void(content::CertificateRequestResultType)>(), | 147 base::Callback<void(content::CertificateRequestResultType)>(), |
| 147 is_wifi_connection, wifi_ssid); | 148 is_wifi_connection, wifi_ssid); |
| 148 blocking_page->Show(); | 149 blocking_page->Show(); |
| 149 | 150 |
| 150 WaitForInterstitialAttach(contents); | 151 WaitForInterstitialAttach(contents); |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 334 false, ""); | 335 false, ""); |
| 335 return blocking_page; | 336 return blocking_page; |
| 336 } | 337 } |
| 337 }; | 338 }; |
| 338 | 339 |
| 339 // Test that an IDN login domain is decoded properly. | 340 // Test that an IDN login domain is decoded properly. |
| 340 IN_PROC_BROWSER_TEST_F(CaptivePortalBlockingPageIDNTest, | 341 IN_PROC_BROWSER_TEST_F(CaptivePortalBlockingPageIDNTest, |
| 341 ShowLoginIDNIfPortalRedirectsDetectionURL) { | 342 ShowLoginIDNIfPortalRedirectsDetectionURL) { |
| 342 EXPECT_TRUE(VerifyIDNDecoded()); | 343 EXPECT_TRUE(VerifyIDNDecoded()); |
| 343 } | 344 } |
| OLD | NEW |