Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(417)

Unified Diff: ios/web/web_state/ui/crw_web_controller_unittest.mm

Issue 2864133002: Convert iOS to use X509CertificateBytes. (Closed)
Patch Set: static_cast, more unittest Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ios/web/web_state/ui/crw_web_controller.mm ('k') | ios/web/web_state/wk_web_view_security_util.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web/web_state/ui/crw_web_controller_unittest.mm
diff --git a/ios/web/web_state/ui/crw_web_controller_unittest.mm b/ios/web/web_state/ui/crw_web_controller_unittest.mm
index 2f9a6c94872164b3bc2d181c35beab9f8ddb6188..69a0c6080b902831714f4f8394142a65d0ff6db0 100644
--- a/ios/web/web_state/ui/crw_web_controller_unittest.mm
+++ b/ios/web/web_state/ui/crw_web_controller_unittest.mm
@@ -38,6 +38,7 @@
#import "ios/web/web_state/web_state_impl.h"
#import "ios/web/web_state/wk_web_view_security_util.h"
#import "net/base/mac/url_conversions.h"
+#include "net/cert/x509_util_ios_and_mac.h"
#include "net/ssl/ssl_info.h"
#include "net/test/cert_test_util.h"
#include "net/test/test_data_directory.h"
@@ -189,14 +190,18 @@ TEST_F(CRWWebControllerTest, SslCertError) {
scoped_refptr<net::X509Certificate> cert =
net::ImportCertFromFile(net::GetTestCertsDirectory(), "ok_cert.pem");
+ ASSERT_TRUE(cert);
+ base::ScopedCFTypeRef<CFMutableArrayRef> chain(
+ net::x509_util::CreateSecCertificateArrayForX509Certificate(cert.get()));
+ ASSERT_TRUE(chain);
- NSArray* chain = @[ static_cast<id>(cert->os_cert_handle()) ];
GURL url("https://chromium.test");
NSError* error =
[NSError errorWithDomain:NSURLErrorDomain
code:NSURLErrorServerCertificateHasUnknownRoot
userInfo:@{
- web::kNSErrorPeerCertificateChainKey : chain,
+ web::kNSErrorPeerCertificateChainKey :
+ static_cast<NSArray*>(chain.get()),
web::kNSErrorFailingURLKey : net::NSURLWithGURL(url),
}];
base::scoped_nsobject<NSObject> navigation([[NSObject alloc] init]);
« no previous file with comments | « ios/web/web_state/ui/crw_web_controller.mm ('k') | ios/web/web_state/wk_web_view_security_util.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698