| 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 } | 60 } |
| 61 #endif // USE_NSS | 61 #endif // USE_NSS |
| 62 | 62 |
| 63 } // namespace | 63 } // namespace |
| 64 | 64 |
| 65 class ONCCertificateImporterImplTest : public testing::Test { | 65 class ONCCertificateImporterImplTest : public testing::Test { |
| 66 public: | 66 public: |
| 67 ONCCertificateImporterImplTest() {} | 67 ONCCertificateImporterImplTest() {} |
| 68 virtual ~ONCCertificateImporterImplTest() {} | 68 virtual ~ONCCertificateImporterImplTest() {} |
| 69 | 69 |
| 70 virtual void SetUp() OVERRIDE { | 70 virtual void SetUp() override { |
| 71 ASSERT_TRUE(public_nssdb_.is_open()); | 71 ASSERT_TRUE(public_nssdb_.is_open()); |
| 72 ASSERT_TRUE(private_nssdb_.is_open()); | 72 ASSERT_TRUE(private_nssdb_.is_open()); |
| 73 | 73 |
| 74 task_runner_ = new base::TestSimpleTaskRunner(); | 74 task_runner_ = new base::TestSimpleTaskRunner(); |
| 75 thread_task_runner_handle_.reset( | 75 thread_task_runner_handle_.reset( |
| 76 new base::ThreadTaskRunnerHandle(task_runner_)); | 76 new base::ThreadTaskRunnerHandle(task_runner_)); |
| 77 | 77 |
| 78 test_nssdb_.reset(new net::NSSCertDatabaseChromeOS( | 78 test_nssdb_.reset(new net::NSSCertDatabaseChromeOS( |
| 79 crypto::ScopedPK11Slot(PK11_ReferenceSlot(public_nssdb_.slot())), | 79 crypto::ScopedPK11Slot(PK11_ReferenceSlot(public_nssdb_.slot())), |
| 80 crypto::ScopedPK11Slot(PK11_ReferenceSlot(private_nssdb_.slot())))); | 80 crypto::ScopedPK11Slot(PK11_ReferenceSlot(private_nssdb_.slot())))); |
| 81 | 81 |
| 82 // Test db should be empty at start of test. | 82 // Test db should be empty at start of test. |
| 83 EXPECT_TRUE(ListCertsInPublicSlot().empty()); | 83 EXPECT_TRUE(ListCertsInPublicSlot().empty()); |
| 84 EXPECT_TRUE(ListCertsInPrivateSlot().empty()); | 84 EXPECT_TRUE(ListCertsInPrivateSlot().empty()); |
| 85 } | 85 } |
| 86 | 86 |
| 87 virtual void TearDown() OVERRIDE { | 87 virtual void TearDown() override { |
| 88 thread_task_runner_handle_.reset(); | 88 thread_task_runner_handle_.reset(); |
| 89 task_runner_ = NULL; | 89 task_runner_ = NULL; |
| 90 } | 90 } |
| 91 | 91 |
| 92 protected: | 92 protected: |
| 93 void OnImportCompleted(bool expected_success, | 93 void OnImportCompleted(bool expected_success, |
| 94 bool success, | 94 bool success, |
| 95 const net::CertificateList& onc_trusted_certificates) { | 95 const net::CertificateList& onc_trusted_certificates) { |
| 96 EXPECT_EQ(expected_success, success); | 96 EXPECT_EQ(expected_success, success); |
| 97 web_trust_certificates_ = onc_trusted_certificates; | 97 web_trust_certificates_ = onc_trusted_certificates; |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 341 "certificate-client-update.onc"), | 341 "certificate-client-update.onc"), |
| 342 CertParam(net::SERVER_CERT, | 342 CertParam(net::SERVER_CERT, |
| 343 "certificate-server.onc", | 343 "certificate-server.onc", |
| 344 "certificate-server-update.onc"), | 344 "certificate-server-update.onc"), |
| 345 CertParam(net::CA_CERT, | 345 CertParam(net::CA_CERT, |
| 346 "certificate-web-authority.onc", | 346 "certificate-web-authority.onc", |
| 347 "certificate-web-authority-update.onc"))); | 347 "certificate-web-authority-update.onc"))); |
| 348 | 348 |
| 349 } // namespace onc | 349 } // namespace onc |
| 350 } // namespace chromeos | 350 } // namespace chromeos |
| OLD | NEW |