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

Side by Side Diff: ios/web/web_state/wk_web_view_security_util_unittest.mm

Issue 2073663002: Correct SecTrustResultType init for latest Xcode beta. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #import "ios/web/web_state/wk_web_view_security_util.h" 5 #import "ios/web/web_state/wk_web_view_security_util.h"
6 6
7 #import <Foundation/Foundation.h> 7 #import <Foundation/Foundation.h>
8 #include <Security/Security.h> 8 #include <Security/Security.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 TEST_F(WKWebViewSecurityUtilTest, CreationCertFromEmptyChain) { 80 TEST_F(WKWebViewSecurityUtilTest, CreationCertFromEmptyChain) {
81 EXPECT_FALSE(CreateCertFromChain(@[])); 81 EXPECT_FALSE(CreateCertFromChain(@[]));
82 } 82 }
83 83
84 // Tests MakeTrustValid with self-signed cert. 84 // Tests MakeTrustValid with self-signed cert.
85 TEST_F(WKWebViewSecurityUtilTest, MakingTrustValid) { 85 TEST_F(WKWebViewSecurityUtilTest, MakingTrustValid) {
86 // Create invalid trust object. 86 // Create invalid trust object.
87 base::ScopedCFTypeRef<SecTrustRef> trust = 87 base::ScopedCFTypeRef<SecTrustRef> trust =
88 CreateTestTrust(MakeTestCertChain(kTestSubject)); 88 CreateTestTrust(MakeTestCertChain(kTestSubject));
89 89
90 SecTrustResultType result = -1; 90 SecTrustResultType result = kSecTrustResultInvalid;
91 SecTrustEvaluate(trust, &result); 91 SecTrustEvaluate(trust, &result);
92 EXPECT_EQ(kSecTrustResultRecoverableTrustFailure, result); 92 EXPECT_EQ(kSecTrustResultRecoverableTrustFailure, result);
93 93
94 // Make sure that trust becomes valid after 94 // Make sure that trust becomes valid after
95 // |EnsureFutureTrustEvaluationSucceeds| call. 95 // |EnsureFutureTrustEvaluationSucceeds| call.
96 EnsureFutureTrustEvaluationSucceeds(trust); 96 EnsureFutureTrustEvaluationSucceeds(trust);
97 SecTrustEvaluate(trust, &result); 97 SecTrustEvaluate(trust, &result);
98 EXPECT_EQ(kSecTrustResultProceed, result); 98 EXPECT_EQ(kSecTrustResultProceed, result);
99 } 99 }
100 100
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 GetSecurityStyleFromTrustResult(kSecTrustResultUnspecified)); 276 GetSecurityStyleFromTrustResult(kSecTrustResultUnspecified));
277 } 277 }
278 278
279 // Tests GetSecurityStyleFromTrustResult with invalid SecTrustResultType result. 279 // Tests GetSecurityStyleFromTrustResult with invalid SecTrustResultType result.
280 TEST_F(WKWebViewSecurityUtilTest, GetSecurityStyleFromInvalidResult) { 280 TEST_F(WKWebViewSecurityUtilTest, GetSecurityStyleFromInvalidResult) {
281 EXPECT_EQ(SECURITY_STYLE_UNKNOWN, 281 EXPECT_EQ(SECURITY_STYLE_UNKNOWN,
282 GetSecurityStyleFromTrustResult(kSecTrustResultInvalid)); 282 GetSecurityStyleFromTrustResult(kSecTrustResultInvalid));
283 } 283 }
284 284
285 } // namespace web 285 } // namespace web
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698