OLD | NEW |
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 #include "ios/web/net/crw_cert_verification_controller.h" | 5 #include "ios/web/net/crw_cert_verification_controller.h" |
6 | 6 |
7 #include "base/mac/bind_objc_block.h" | 7 #include "base/mac/bind_objc_block.h" |
8 #include "base/mac/scoped_nsobject.h" | 8 #include "base/mac/scoped_nsobject.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/test/ios/wait_util.h" | 10 #include "base/test/ios/wait_util.h" |
11 #include "ios/web/public/test/web_test.h" | 11 #include "ios/web/public/test/web_test.h" |
12 #include "ios/web/public/web_thread.h" | 12 #include "ios/web/public/web_thread.h" |
13 #import "ios/web/web_state/wk_web_view_security_util.h" | 13 #import "ios/web/web_state/wk_web_view_security_util.h" |
14 #include "net/base/test_data_directory.h" | |
15 #include "net/cert/mock_cert_verifier.h" | 14 #include "net/cert/mock_cert_verifier.h" |
16 #include "net/cert/x509_certificate.h" | 15 #include "net/cert/x509_certificate.h" |
17 #include "net/test/cert_test_util.h" | 16 #include "net/test/cert_test_util.h" |
| 17 #include "net/test/test_data_directory.h" |
18 #include "net/url_request/url_request_context.h" | 18 #include "net/url_request/url_request_context.h" |
19 #include "net/url_request/url_request_context_getter.h" | 19 #include "net/url_request/url_request_context_getter.h" |
20 | 20 |
21 namespace web { | 21 namespace web { |
22 | 22 |
23 namespace { | 23 namespace { |
24 // Generated cert filename. | 24 // Generated cert filename. |
25 const char kCertFileName[] = "ok_cert.pem"; | 25 const char kCertFileName[] = "ok_cert.pem"; |
26 // Test hostname for cert verification. | 26 // Test hostname for cert verification. |
27 NSString* const kHostName = @"www.example.com"; | 27 NSString* const kHostName = @"www.example.com"; |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 | 255 |
256 SecurityStyle style = SECURITY_STYLE_UNKNOWN; | 256 SecurityStyle style = SECURITY_STYLE_UNKNOWN; |
257 net::CertStatus status = net::CERT_STATUS_ALL_ERRORS; | 257 net::CertStatus status = net::CERT_STATUS_ALL_ERRORS; |
258 | 258 |
259 QueryStatus(invalid_trust_, kHostName, &style, &status); | 259 QueryStatus(invalid_trust_, kHostName, &style, &status); |
260 EXPECT_EQ(SECURITY_STYLE_AUTHENTICATION_BROKEN, style); | 260 EXPECT_EQ(SECURITY_STYLE_AUTHENTICATION_BROKEN, style); |
261 EXPECT_EQ(net::CERT_STATUS_DATE_INVALID, status); | 261 EXPECT_EQ(net::CERT_STATUS_DATE_INVALID, status); |
262 } | 262 } |
263 | 263 |
264 } // namespace web | 264 } // namespace web |
OLD | NEW |