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 | 8 |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
271 } | 271 } |
272 | 272 |
273 // Same as above, with no SSID and no login URL. | 273 // Same as above, with no SSID and no login URL. |
274 IN_PROC_BROWSER_TEST_F(CaptivePortalBlockingPageTest, | 274 IN_PROC_BROWSER_TEST_F(CaptivePortalBlockingPageTest, |
275 WiFi_NoSSID_NoLoginURL) { | 275 WiFi_NoSSID_NoLoginURL) { |
276 const GURL kLandingUrl(captive_portal::CaptivePortalDetector::kDefaultURL); | 276 const GURL kLandingUrl(captive_portal::CaptivePortalDetector::kDefaultURL); |
277 TestInterstitial(true, std::string(), kLandingUrl, EXPECT_WIFI_YES, | 277 TestInterstitial(true, std::string(), kLandingUrl, EXPECT_WIFI_YES, |
278 EXPECT_WIFI_SSID_NO, EXPECT_LOGIN_URL_NO); | 278 EXPECT_WIFI_SSID_NO, EXPECT_LOGIN_URL_NO); |
279 } | 279 } |
280 | 280 |
281 IN_PROC_BROWSER_TEST_F(CaptivePortalBlockingPageTest, CertReportingOptIn) { | 281 IN_PROC_BROWSER_TEST_F(CaptivePortalBlockingPageTest, CertReportingOptIn) { |
meacer
2015/07/21 06:04:31
nit: Can you add a comment here saying something l
estark
2015/07/21 14:50:09
Done. I also remove the Finch check from the next
| |
282 CertificateReportingTestUtils::SetCertReportingFinchConfig( | 282 if (CertificateReportingTestUtils::GetReportExpectedFromFinch() == |
283 CertReportHelper::kFinchGroupShowPossiblySend, "1.0"); | 283 CertificateReportingTestUtils::CERT_REPORT_EXPECTED) { |
284 TestCertReporting(CertificateReportingTestUtils::EXTENDED_REPORTING_OPT_IN); | 284 TestCertReporting(CertificateReportingTestUtils::EXTENDED_REPORTING_OPT_IN); |
285 } | |
285 } | 286 } |
286 | 287 |
287 IN_PROC_BROWSER_TEST_F(CaptivePortalBlockingPageTest, CertReportingOptOut) { | 288 IN_PROC_BROWSER_TEST_F(CaptivePortalBlockingPageTest, CertReportingOptOut) { |
288 CertificateReportingTestUtils::SetCertReportingFinchConfig( | 289 if (CertificateReportingTestUtils::GetReportExpectedFromFinch() == |
289 CertReportHelper::kFinchGroupShowPossiblySend, "1.0"); | 290 CertificateReportingTestUtils::CERT_REPORT_EXPECTED) { |
290 TestCertReporting( | 291 TestCertReporting( |
291 CertificateReportingTestUtils::EXTENDED_REPORTING_DO_NOT_OPT_IN); | 292 CertificateReportingTestUtils::EXTENDED_REPORTING_DO_NOT_OPT_IN); |
293 } | |
292 } | 294 } |
293 | 295 |
294 class CaptivePortalBlockingPageIDNTest : public SecurityInterstitialIDNTest { | 296 class CaptivePortalBlockingPageIDNTest : public SecurityInterstitialIDNTest { |
295 protected: | 297 protected: |
296 // SecurityInterstitialIDNTest implementation | 298 // SecurityInterstitialIDNTest implementation |
297 SecurityInterstitialPage* CreateInterstitial( | 299 SecurityInterstitialPage* CreateInterstitial( |
298 content::WebContents* contents, | 300 content::WebContents* contents, |
299 const GURL& request_url) const override { | 301 const GURL& request_url) const override { |
300 // Delegate is owned by the blocking page. | 302 // Delegate is owned by the blocking page. |
301 FakeConnectionInfoDelegate* delegate = | 303 FakeConnectionInfoDelegate* delegate = |
302 new FakeConnectionInfoDelegate(false, std::string()); | 304 new FakeConnectionInfoDelegate(false, std::string()); |
303 net::SSLInfo empty_ssl_info; | 305 net::SSLInfo empty_ssl_info; |
304 // Blocking page is owned by the interstitial. | 306 // Blocking page is owned by the interstitial. |
305 CaptivePortalBlockingPage* blocking_page = new CaptivePortalBlockingPage( | 307 CaptivePortalBlockingPage* blocking_page = new CaptivePortalBlockingPage( |
306 contents, GURL(kBrokenSSL), request_url, nullptr, empty_ssl_info, | 308 contents, GURL(kBrokenSSL), request_url, nullptr, empty_ssl_info, |
307 base::Callback<void(bool)>()); | 309 base::Callback<void(bool)>()); |
308 blocking_page->SetDelegate(delegate); | 310 blocking_page->SetDelegate(delegate); |
309 return blocking_page; | 311 return blocking_page; |
310 } | 312 } |
311 }; | 313 }; |
312 | 314 |
313 // Test that an IDN login domain is decoded properly. | 315 // Test that an IDN login domain is decoded properly. |
314 IN_PROC_BROWSER_TEST_F(CaptivePortalBlockingPageIDNTest, | 316 IN_PROC_BROWSER_TEST_F(CaptivePortalBlockingPageIDNTest, |
315 ShowLoginIDNIfPortalRedirectsDetectionURL) { | 317 ShowLoginIDNIfPortalRedirectsDetectionURL) { |
316 EXPECT_TRUE(VerifyIDNDecoded()); | 318 EXPECT_TRUE(VerifyIDNDecoded()); |
317 } | 319 } |
OLD | NEW |