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

Unified Diff: ios/web/net/crw_ssl_status_updater_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
Index: ios/web/net/crw_ssl_status_updater_unittest.mm
diff --git a/ios/web/net/crw_ssl_status_updater_unittest.mm b/ios/web/net/crw_ssl_status_updater_unittest.mm
index 96c773108d684c093a079a9e49c710a2f79b010d..0beecd9503abfe711ed502decc72fab2ee0d8135 100644
--- a/ios/web/net/crw_ssl_status_updater_unittest.mm
+++ b/ios/web/net/crw_ssl_status_updater_unittest.mm
@@ -13,6 +13,7 @@
#include "ios/web/public/ssl_status.h"
#include "ios/web/public/test/web_test.h"
#import "ios/web/web_state/wk_web_view_security_util.h"
+#include "net/cert/x509_util_ios_and_mac.h"
#include "net/test/cert_test_util.h"
#include "net/test/test_data_directory.h"
#include "third_party/ocmock/OCMock/OCMock.h"
@@ -92,8 +93,12 @@ class CRWSSLStatusUpdaterTest : public web::WebTest {
scoped_refptr<net::X509Certificate> cert =
net::ImportCertFromFile(net::GetTestCertsDirectory(), kCertFileName);
ASSERT_TRUE(cert);
- NSArray* chain = @[ static_cast<id>(cert->os_cert_handle()) ];
- trust_ = CreateServerTrustFromChain(chain, kHostName);
+ base::ScopedCFTypeRef<CFMutableArrayRef> chain(
+ net::x509_util::CreateSecCertificateArrayForX509Certificate(
+ cert.get()));
+ ASSERT_TRUE(chain);
+ trust_ = CreateServerTrustFromChain(static_cast<NSArray*>(chain.get()),
+ kHostName);
}
void TearDown() override {
« no previous file with comments | « ios/web/net/crw_cert_verification_controller_unittest.mm ('k') | ios/web/web_state/ui/crw_web_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698