OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/ssl_error_handler.h" | 5 #include "chrome/browser/ssl/ssl_error_handler.h" |
6 | 6 |
7 #include "base/callback.h" | 7 #include "base/callback.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "base/metrics/field_trial.h" | 9 #include "base/metrics/field_trial.h" |
10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 class TestSSLErrorHandler : public SSLErrorHandler { | 22 class TestSSLErrorHandler : public SSLErrorHandler { |
23 public: | 23 public: |
24 TestSSLErrorHandler(Profile* profile, | 24 TestSSLErrorHandler(Profile* profile, |
25 content::WebContents* web_contents, | 25 content::WebContents* web_contents, |
26 const net::SSLInfo& ssl_info) | 26 const net::SSLInfo& ssl_info) |
27 : SSLErrorHandler(web_contents, | 27 : SSLErrorHandler(web_contents, |
28 net::ERR_CERT_COMMON_NAME_INVALID, | 28 net::ERR_CERT_COMMON_NAME_INVALID, |
29 ssl_info, | 29 ssl_info, |
30 GURL(), | 30 GURL(), |
31 0, | 31 0, |
| 32 nullptr, |
32 base::Callback<void(bool)>()), | 33 base::Callback<void(bool)>()), |
33 profile_(profile), | 34 profile_(profile), |
34 captive_portal_checked_(false), | 35 captive_portal_checked_(false), |
35 ssl_interstitial_shown_(false), | 36 ssl_interstitial_shown_(false), |
36 captive_portal_interstitial_shown_(false) { | 37 captive_portal_interstitial_shown_(false) {} |
37 } | |
38 | 38 |
39 ~TestSSLErrorHandler() override { | 39 ~TestSSLErrorHandler() override { |
40 } | 40 } |
41 | 41 |
42 using SSLErrorHandler::StartHandlingError; | 42 using SSLErrorHandler::StartHandlingError; |
43 | 43 |
44 void SendCaptivePortalNotification( | 44 void SendCaptivePortalNotification( |
45 captive_portal::CaptivePortalResult result) { | 45 captive_portal::CaptivePortalResult result) { |
46 CaptivePortalService::Results results; | 46 CaptivePortalService::Results results; |
47 results.previous_result = captive_portal::RESULT_INTERNET_CONNECTED; | 47 results.previous_result = captive_portal::RESULT_INTERNET_CONNECTED; |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 ShouldShowSSLInterstitialOnCaptivePortalDetectionDisabled) { | 197 ShouldShowSSLInterstitialOnCaptivePortalDetectionDisabled) { |
198 EXPECT_FALSE(error_handler()->IsTimerRunning()); | 198 EXPECT_FALSE(error_handler()->IsTimerRunning()); |
199 error_handler()->StartHandlingError(); | 199 error_handler()->StartHandlingError(); |
200 EXPECT_FALSE(error_handler()->IsTimerRunning()); | 200 EXPECT_FALSE(error_handler()->IsTimerRunning()); |
201 EXPECT_FALSE(error_handler()->captive_portal_checked()); | 201 EXPECT_FALSE(error_handler()->captive_portal_checked()); |
202 EXPECT_TRUE(error_handler()->ssl_interstitial_shown()); | 202 EXPECT_TRUE(error_handler()->ssl_interstitial_shown()); |
203 EXPECT_FALSE(error_handler()->captive_portal_interstitial_shown()); | 203 EXPECT_FALSE(error_handler()->captive_portal_interstitial_shown()); |
204 } | 204 } |
205 | 205 |
206 #endif // defined(ENABLE_CAPTIVE_PORTAL_DETECTION) | 206 #endif // defined(ENABLE_CAPTIVE_PORTAL_DETECTION) |
OLD | NEW |