| 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" |
| 11 #import "ios/web/public/web_state/web_state.h" | 11 #import "ios/web/public/web_state/web_state.h" |
| 12 #include "net/ssl/ssl_info.h" | 12 #include "net/ssl/ssl_info.h" |
| 13 #include "net/test/cert_test_util.h" | 13 #include "net/test/cert_test_util.h" |
| 14 #include "net/test/test_data_directory.h" | 14 #include "net/test/test_data_directory.h" |
| 15 | 15 |
| 16 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 17 #error "This file requires ARC support." |
| 18 #endif |
| 19 |
| 16 namespace { | 20 namespace { |
| 17 const char kTestCertFileName[] = "ok_cert.pem"; | 21 const char kTestCertFileName[] = "ok_cert.pem"; |
| 18 const char kTestHostName[] = "https://chromium.test/"; | 22 const char kTestHostName[] = "https://chromium.test/"; |
| 19 } // namespace | 23 } // namespace |
| 20 | 24 |
| 21 // Test fixture for IOSSSLErrorHandler class. | 25 // Test fixture for IOSSSLErrorHandler class. |
| 22 class IOSSSLErrorHandlerTest : public web::WebTestWithWebState { | 26 class IOSSSLErrorHandlerTest : public web::WebTestWithWebState { |
| 23 protected: | 27 protected: |
| 24 IOSSSLErrorHandlerTest() | 28 IOSSSLErrorHandlerTest() |
| 25 : browser_state_(builder_.Build()), | 29 : browser_state_(builder_.Build()), |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 | 109 |
| 106 // Make sure that interstitial is displayed. | 110 // Make sure that interstitial is displayed. |
| 107 EXPECT_TRUE(web_state()->IsShowingWebInterstitial()); | 111 EXPECT_TRUE(web_state()->IsShowingWebInterstitial()); |
| 108 web::WebInterstitial* interstitial = web_state()->GetWebInterstitial(); | 112 web::WebInterstitial* interstitial = web_state()->GetWebInterstitial(); |
| 109 EXPECT_TRUE(interstitial); | 113 EXPECT_TRUE(interstitial); |
| 110 | 114 |
| 111 // Make sure callback is called on dismissal. | 115 // Make sure callback is called on dismissal. |
| 112 interstitial->DontProceed(); | 116 interstitial->DontProceed(); |
| 113 EXPECT_TRUE(do_not_proceed_callback_called); | 117 EXPECT_TRUE(do_not_proceed_callback_called); |
| 114 } | 118 } |
| OLD | NEW |