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 "chromeos/network/onc/onc_certificate_importer_impl.h" | 5 #include "chromeos/network/onc/onc_certificate_importer_impl.h" |
6 | 6 |
7 #include <cert.h> | 7 #include <cert.h> |
8 #include <certdb.h> | 8 #include <certdb.h> |
9 #include <keyhi.h> | 9 #include <keyhi.h> |
10 #include <pk11pub.h> | 10 #include <pk11pub.h> |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 EXPECT_TRUE(CleanupSlotContents()); | 73 EXPECT_TRUE(CleanupSlotContents()); |
74 EXPECT_EQ(0ul, ListCertsInSlot().size()); | 74 EXPECT_EQ(0ul, ListCertsInSlot().size()); |
75 } | 75 } |
76 | 76 |
77 virtual ~ONCCertificateImporterImplTest() {} | 77 virtual ~ONCCertificateImporterImplTest() {} |
78 | 78 |
79 protected: | 79 protected: |
80 void AddCertificatesFromFile(std::string filename, bool expected_success) { | 80 void AddCertificatesFromFile(std::string filename, bool expected_success) { |
81 scoped_ptr<base::DictionaryValue> onc = | 81 scoped_ptr<base::DictionaryValue> onc = |
82 test_utils::ReadTestDictionary(filename); | 82 test_utils::ReadTestDictionary(filename); |
83 base::Value* certificates_value = NULL; | 83 scoped_ptr<base::Value> certificates_value; |
84 base::ListValue* certificates = NULL; | 84 base::ListValue* certificates = NULL; |
85 onc->RemoveWithoutPathExpansion(toplevel_config::kCertificates, | 85 onc->RemoveWithoutPathExpansion(toplevel_config::kCertificates, |
86 &certificates_value); | 86 &certificates_value); |
87 certificates_value->GetAsList(&certificates); | 87 certificates_value.release()->GetAsList(&certificates); |
88 onc_certificates_.reset(certificates); | 88 onc_certificates_.reset(certificates); |
89 | 89 |
90 web_trust_certificates_.clear(); | 90 web_trust_certificates_.clear(); |
91 imported_server_and_ca_certs_.clear(); | 91 imported_server_and_ca_certs_.clear(); |
92 CertificateImporterImpl importer; | 92 CertificateImporterImpl importer; |
93 EXPECT_EQ( | 93 EXPECT_EQ( |
94 expected_success, | 94 expected_success, |
95 importer.ParseAndStoreCertificates(true, // allow web trust | 95 importer.ParseAndStoreCertificates(true, // allow web trust |
96 *certificates, | 96 *certificates, |
97 &web_trust_certificates_, | 97 &web_trust_certificates_, |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
312 "certificate-client-update.onc"), | 312 "certificate-client-update.onc"), |
313 CertParam(net::SERVER_CERT, | 313 CertParam(net::SERVER_CERT, |
314 "certificate-server.onc", | 314 "certificate-server.onc", |
315 "certificate-server-update.onc"), | 315 "certificate-server-update.onc"), |
316 CertParam(net::CA_CERT, | 316 CertParam(net::CA_CERT, |
317 "certificate-web-authority.onc", | 317 "certificate-web-authority.onc", |
318 "certificate-web-authority-update.onc"))); | 318 "certificate-web-authority-update.onc"))); |
319 | 319 |
320 } // namespace onc | 320 } // namespace onc |
321 } // namespace chromeos | 321 } // namespace chromeos |
OLD | NEW |