OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/client_cert_store_chromeos.h" | 5 #include "net/ssl/client_cert_store_chromeos.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 const SSLCertRequestInfo& cert_request_info, | 30 const SSLCertRequestInfo& cert_request_info, |
31 CertificateList* selected_certs) { | 31 CertificateList* selected_certs) { |
32 return store_.SelectClientCertsForTesting( | 32 return store_.SelectClientCertsForTesting( |
33 input_certs, cert_request_info, selected_certs); | 33 input_certs, cert_request_info, selected_certs); |
34 } | 34 } |
35 | 35 |
36 private: | 36 private: |
37 ClientCertStoreChromeOS store_; | 37 ClientCertStoreChromeOS store_; |
38 }; | 38 }; |
39 | 39 |
40 INSTANTIATE_TYPED_TEST_CASE_P(ChromeOS, | |
41 ClientCertStoreTest, | |
42 ClientCertStoreChromeOSTestDelegate); | |
43 | |
44 class ClientCertStoreChromeOSTest : public ::testing::Test { | 40 class ClientCertStoreChromeOSTest : public ::testing::Test { |
45 public: | 41 public: |
46 scoped_refptr<X509Certificate> ImportCertForUser( | 42 scoped_refptr<X509Certificate> ImportCertForUser( |
47 const std::string& username_hash, | 43 const std::string& username_hash, |
48 const std::string& filename, | 44 const std::string& filename, |
49 const std::string& password) { | 45 const std::string& password) { |
50 crypto::ScopedPK11Slot slot( | 46 crypto::ScopedPK11Slot slot( |
51 crypto::GetPublicSlotForChromeOSUser(username_hash)); | 47 crypto::GetPublicSlotForChromeOSUser(username_hash)); |
52 EXPECT_TRUE(slot.get()); | 48 EXPECT_TRUE(slot.get()); |
53 if (!slot.get()) | 49 if (!slot.get()) |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 run_loop_1.Run(); | 180 run_loop_1.Run(); |
185 run_loop_2.Run(); | 181 run_loop_2.Run(); |
186 | 182 |
187 ASSERT_EQ(1u, request_1->client_certs.size()); | 183 ASSERT_EQ(1u, request_1->client_certs.size()); |
188 EXPECT_TRUE(cert_1->Equals(request_1->client_certs[0])); | 184 EXPECT_TRUE(cert_1->Equals(request_1->client_certs[0])); |
189 // TODO(mattm): Request for second user will have zero results due to | 185 // TODO(mattm): Request for second user will have zero results due to |
190 // crbug.com/315285. Update the test once that is fixed. | 186 // crbug.com/315285. Update the test once that is fixed. |
191 } | 187 } |
192 | 188 |
193 } // namespace net | 189 } // namespace net |
OLD | NEW |