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 "chrome/browser/chromeos/net/client_cert_store_chromeos.h" | 5 #include "chrome/browser/chromeos/net/client_cert_store_chromeos.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
11 #include "base/files/file_path.h" | 11 #include "base/files/file_path.h" |
12 #include "base/location.h" | 12 #include "base/location.h" |
13 #include "base/memory/ptr_util.h" | 13 #include "base/memory/ptr_util.h" |
14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
15 #include "base/message_loop/message_loop.h" | 15 #include "base/message_loop/message_loop.h" |
16 #include "base/run_loop.h" | 16 #include "base/run_loop.h" |
17 #include "base/single_thread_task_runner.h" | 17 #include "base/single_thread_task_runner.h" |
18 #include "base/threading/thread_task_runner_handle.h" | 18 #include "base/threading/thread_task_runner_handle.h" |
19 #include "chrome/browser/chromeos/certificate_provider/certificate_provider.h" | 19 #include "chrome/browser/chromeos/certificate_provider/certificate_provider.h" |
20 #include "crypto/scoped_test_nss_db.h" | 20 #include "crypto/scoped_test_nss_db.h" |
21 #include "net/base/test_data_directory.h" | |
22 #include "net/cert/x509_certificate.h" | 21 #include "net/cert/x509_certificate.h" |
23 #include "net/ssl/ssl_cert_request_info.h" | 22 #include "net/ssl/ssl_cert_request_info.h" |
24 #include "net/test/cert_test_util.h" | 23 #include "net/test/cert_test_util.h" |
| 24 #include "net/test/test_data_directory.h" |
25 #include "testing/gtest/include/gtest/gtest.h" | 25 #include "testing/gtest/include/gtest/gtest.h" |
26 | 26 |
27 namespace chromeos { | 27 namespace chromeos { |
28 | 28 |
29 namespace { | 29 namespace { |
30 | 30 |
31 // "CN=B CA" - DER encoded DN of the issuer of client_1.pem | 31 // "CN=B CA" - DER encoded DN of the issuer of client_1.pem |
32 const unsigned char kAuthority1DN[] = {0x30, 0x0f, 0x31, 0x0d, 0x30, 0x0b, | 32 const unsigned char kAuthority1DN[] = {0x30, 0x0f, 0x31, 0x0d, 0x30, 0x0b, |
33 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, | 33 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, |
34 0x04, 0x42, 0x20, 0x43, 0x41}; | 34 0x04, 0x42, 0x20, 0x43, 0x41}; |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 base::RunLoop run_loop; | 228 base::RunLoop run_loop; |
229 net::CertificateList selected_certs; | 229 net::CertificateList selected_certs; |
230 store.GetClientCerts(*request, &selected_certs, run_loop.QuitClosure()); | 230 store.GetClientCerts(*request, &selected_certs, run_loop.QuitClosure()); |
231 run_loop.Run(); | 231 run_loop.Run(); |
232 | 232 |
233 ASSERT_EQ(1u, selected_certs.size()); | 233 ASSERT_EQ(1u, selected_certs.size()); |
234 EXPECT_TRUE(cert_1->Equals(selected_certs[0].get())); | 234 EXPECT_TRUE(cert_1->Equals(selected_certs[0].get())); |
235 } | 235 } |
236 | 236 |
237 } // namespace chromeos | 237 } // namespace chromeos |
OLD | NEW |