| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "ios/chrome/browser/ssl/ios_ssl_error_handler.h" | 5 #include "ios/chrome/browser/ssl/ios_ssl_error_handler.h" |
| 6 | 6 |
| 7 #include "base/mac/bind_objc_block.h" | 7 #include "base/mac/bind_objc_block.h" |
| 8 #include "ios/chrome/browser/browser_state/test_chrome_browser_state.h" | 8 #include "ios/chrome/browser/browser_state/test_chrome_browser_state.h" |
| 9 #include "ios/web/public/interstitials/web_interstitial.h" | 9 #include "ios/web/public/interstitials/web_interstitial.h" |
| 10 #import "ios/web/public/test/web_test_with_web_state.h" | 10 #import "ios/web/public/test/web_test_with_web_state.h" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 EXPECT_TRUE(web_state()->IsShowingWebInterstitial()); | 60 EXPECT_TRUE(web_state()->IsShowingWebInterstitial()); |
| 61 web::WebInterstitial* interstitial = web_state()->GetWebInterstitial(); | 61 web::WebInterstitial* interstitial = web_state()->GetWebInterstitial(); |
| 62 EXPECT_TRUE(interstitial); | 62 EXPECT_TRUE(interstitial); |
| 63 | 63 |
| 64 // Make sure callback is called on dismissal. | 64 // Make sure callback is called on dismissal. |
| 65 interstitial->DontProceed(); | 65 interstitial->DontProceed(); |
| 66 EXPECT_TRUE(do_not_proceed_callback_called); | 66 EXPECT_TRUE(do_not_proceed_callback_called); |
| 67 } | 67 } |
| 68 | 68 |
| 69 // Tests proceed with overridable error. | 69 // Tests proceed with overridable error. |
| 70 TEST_F(IOSSSLErrorHandlerTest, OverridableProceed) { | 70 // Flaky: http://crbug.com/660343. |
| 71 TEST_F(IOSSSLErrorHandlerTest, DISABLED_OverridableProceed) { |
| 71 net::SSLInfo ssl_info; | 72 net::SSLInfo ssl_info; |
| 72 ssl_info.cert = cert(); | 73 ssl_info.cert = cert(); |
| 73 GURL url(kTestHostName); | 74 GURL url(kTestHostName); |
| 74 __block bool proceed_callback_called = false; | 75 __block bool proceed_callback_called = false; |
| 75 IOSSSLErrorHandler::HandleSSLError( | 76 IOSSSLErrorHandler::HandleSSLError( |
| 76 web_state(), net::ERR_CERT_AUTHORITY_INVALID, ssl_info, url, true, | 77 web_state(), net::ERR_CERT_AUTHORITY_INVALID, ssl_info, url, true, |
| 77 base::BindBlock(^(bool proceed) { | 78 base::BindBlock(^(bool proceed) { |
| 78 EXPECT_TRUE(proceed); | 79 EXPECT_TRUE(proceed); |
| 79 proceed_callback_called = true; | 80 proceed_callback_called = true; |
| 80 })); | 81 })); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 104 | 105 |
| 105 // Make sure that interstitial is displayed. | 106 // Make sure that interstitial is displayed. |
| 106 EXPECT_TRUE(web_state()->IsShowingWebInterstitial()); | 107 EXPECT_TRUE(web_state()->IsShowingWebInterstitial()); |
| 107 web::WebInterstitial* interstitial = web_state()->GetWebInterstitial(); | 108 web::WebInterstitial* interstitial = web_state()->GetWebInterstitial(); |
| 108 EXPECT_TRUE(interstitial); | 109 EXPECT_TRUE(interstitial); |
| 109 | 110 |
| 110 // Make sure callback is called on dismissal. | 111 // Make sure callback is called on dismissal. |
| 111 interstitial->DontProceed(); | 112 interstitial->DontProceed(); |
| 112 EXPECT_TRUE(do_not_proceed_callback_called); | 113 EXPECT_TRUE(do_not_proceed_callback_called); |
| 113 } | 114 } |
| OLD | NEW |