| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "net/base/multi_threaded_cert_verifier.h" | 5 #include "net/base/multi_threaded_cert_verifier.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
| 9 #include "base/format_macros.h" | 9 #include "base/format_macros.h" |
| 10 #include "base/stringprintf.h" | 10 #include "base/stringprintf.h" |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 public: | 51 public: |
| 52 MultiThreadedCertVerifierTest() { | 52 MultiThreadedCertVerifierTest() { |
| 53 verifier_.SetCertVerifyProc(new MockCertVerifyProc()); | 53 verifier_.SetCertVerifyProc(new MockCertVerifyProc()); |
| 54 } | 54 } |
| 55 virtual ~MultiThreadedCertVerifierTest() {} | 55 virtual ~MultiThreadedCertVerifierTest() {} |
| 56 | 56 |
| 57 protected: | 57 protected: |
| 58 MultiThreadedCertVerifier verifier_; | 58 MultiThreadedCertVerifier verifier_; |
| 59 }; | 59 }; |
| 60 | 60 |
| 61 // Tests a cache hit, which should result in synchronous completion. | 61 TEST_F(MultiThreadedCertVerifierTest, CacheHit) { |
| 62 #if defined(OS_MACOSX) | |
| 63 // http://crbug.com/117372 | |
| 64 #define MAYBE_CacheHit FAILS_CacheHit | |
| 65 #else | |
| 66 #define MAYBE_CacheHit CacheHit | |
| 67 #endif // defined(OS_MACOSX) | |
| 68 TEST_F(MultiThreadedCertVerifierTest, MAYBE_CacheHit) { | |
| 69 FilePath certs_dir = GetTestCertsDirectory(); | 62 FilePath certs_dir = GetTestCertsDirectory(); |
| 70 scoped_refptr<X509Certificate> test_cert( | 63 scoped_refptr<X509Certificate> test_cert( |
| 71 ImportCertFromFile(certs_dir, "ok_cert.pem")); | 64 ImportCertFromFile(certs_dir, "ok_cert.pem")); |
| 72 ASSERT_NE(static_cast<X509Certificate*>(NULL), test_cert); | 65 ASSERT_NE(static_cast<X509Certificate*>(NULL), test_cert); |
| 73 | 66 |
| 74 int error; | 67 int error; |
| 75 CertVerifyResult verify_result; | 68 CertVerifyResult verify_result; |
| 76 TestCompletionCallback callback; | 69 TestCompletionCallback callback; |
| 77 CertVerifier::RequestHandle request_handle; | 70 CertVerifier::RequestHandle request_handle; |
| 78 | 71 |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 326 EXPECT_FALSE(key1 < key2); | 319 EXPECT_FALSE(key1 < key2); |
| 327 EXPECT_TRUE(key2 < key1); | 320 EXPECT_TRUE(key2 < key1); |
| 328 break; | 321 break; |
| 329 default: | 322 default: |
| 330 FAIL() << "Invalid expectation. Can be only -1, 0, 1"; | 323 FAIL() << "Invalid expectation. Can be only -1, 0, 1"; |
| 331 } | 324 } |
| 332 } | 325 } |
| 333 } | 326 } |
| 334 | 327 |
| 335 } // namespace net | 328 } // namespace net |
| OLD | NEW |