OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/ssl/ssl_client_auth_cache.h" | 5 #include "net/ssl/ssl_client_auth_cache.h" |
6 | 6 |
7 #include "base/macros.h" | 7 #include "base/macros.h" |
8 #include "base/time/time.h" | 8 #include "base/time/time.h" |
9 #include "net/cert/x509_certificate.h" | 9 #include "net/cert/x509_certificate.h" |
10 #include "net/ssl/ssl_private_key.h" | 10 #include "net/ssl/ssl_private_key.h" |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 scoped_refptr<X509Certificate> cached_cert; | 187 scoped_refptr<X509Certificate> cached_cert; |
188 scoped_refptr<SSLPrivateKey> cached_pkey; | 188 scoped_refptr<SSLPrivateKey> cached_pkey; |
189 | 189 |
190 // Demonstrate the set up is correct. | 190 // Demonstrate the set up is correct. |
191 EXPECT_TRUE(cache.Lookup(server1, &cached_cert, &cached_pkey)); | 191 EXPECT_TRUE(cache.Lookup(server1, &cached_cert, &cached_pkey)); |
192 EXPECT_EQ(cert1, cached_cert); | 192 EXPECT_EQ(cert1, cached_cert); |
193 | 193 |
194 EXPECT_TRUE(cache.Lookup(server2, &cached_cert, &cached_pkey)); | 194 EXPECT_TRUE(cache.Lookup(server2, &cached_cert, &cached_pkey)); |
195 EXPECT_EQ(nullptr, cached_cert.get()); | 195 EXPECT_EQ(nullptr, cached_cert.get()); |
196 | 196 |
197 cache.OnCertDBChanged(nullptr); | 197 cache.OnCertDBChanged(); |
198 | 198 |
199 // Check that we no longer have entries for either server. | 199 // Check that we no longer have entries for either server. |
200 EXPECT_FALSE(cache.Lookup(server1, &cached_cert, &cached_pkey)); | 200 EXPECT_FALSE(cache.Lookup(server1, &cached_cert, &cached_pkey)); |
201 EXPECT_FALSE(cache.Lookup(server2, &cached_cert, &cached_pkey)); | 201 EXPECT_FALSE(cache.Lookup(server2, &cached_cert, &cached_pkey)); |
202 } | 202 } |
203 | 203 |
204 } // namespace net | 204 } // namespace net |
OLD | NEW |