Chromium Code Reviews| Index: net/base/transport_security_state_unittest.cc |
| diff --git a/net/base/transport_security_state_unittest.cc b/net/base/transport_security_state_unittest.cc |
| index d30c6af9a3987153bc7f113b3357a61dce7a26f7..cb02606cdbe9165176d091a214128f782f34f7f2 100644 |
| --- a/net/base/transport_security_state_unittest.cc |
| +++ b/net/base/transport_security_state_unittest.cc |
| @@ -9,14 +9,18 @@ |
| #include "base/base64.h" |
| #include "base/file_path.h" |
| +#include "base/message_loop.h" |
| #include "base/sha1.h" |
| #include "base/string_piece.h" |
| #include "net/base/asn1_util.h" |
| #include "net/base/cert_test_util.h" |
| #include "net/base/cert_verifier.h" |
| #include "net/base/cert_verify_result.h" |
| +#include "net/base/net_errors.h" |
| +#include "net/base/net_log.h" |
| #include "net/base/ssl_info.h" |
| #include "net/base/test_root_certs.h" |
| +#include "net/base/test_completion_callback.h" |
|
wtc
2012/03/06 23:10:14
Nit: ordering is wrong.
|
| #include "net/base/x509_certificate.h" |
| #include "net/http/http_util.h" |
| #include "testing/gtest/include/gtest/gtest.h" |
| @@ -287,9 +291,17 @@ TEST_F(TransportSecurityStateTest, ValidPinsHeaders) { |
| // Verify has the side-effect of populating public_key_hashes, which |
| // ParsePinsHeader needs. (It wants to check pins against the validated |
| // chain, not just the presented chain.) |
| + int rv = ERR_FAILED; |
| CertVerifyResult result; |
| - int rv = ssl_info.cert->Verify("127.0.0.1", 0, NULL, &result); |
| - ASSERT_EQ(0, rv); |
| + scoped_ptr<CertVerifier> verifier( |
| + CertVerifier::CreateDefaultCertVerifier()); |
| + TestCompletionCallback callback; |
| + CertVerifier::RequestHandle handle = NULL; |
| + rv = verifier->Verify(ssl_info.cert, "127.0.0.1", 0, NULL, &result, |
| + callback.callback(), &handle, BoundNetLog()); |
| + if (rv == ERR_IO_PENDING) |
| + rv = callback.WaitForResult(); |
|
wtc
2012/03/06 23:10:14
Nit: there is a method (GetResult?) that is equiva
|
| + ASSERT_EQ(OK, rv); |
| // Normally, ssl_client_socket_nss would do this, but for a unit test we |
| // fake it. |
| ssl_info.public_key_hashes = result.public_key_hashes; |