OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/cert_loader.h" | 5 #include "chromeos/cert_loader.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 #include <utility> | 10 #include <utility> |
(...skipping 28 matching lines...) Expand all Loading... |
39 | 39 |
40 class TestNSSCertDatabase : public net::NSSCertDatabaseChromeOS { | 40 class TestNSSCertDatabase : public net::NSSCertDatabaseChromeOS { |
41 public: | 41 public: |
42 TestNSSCertDatabase(crypto::ScopedPK11Slot public_slot, | 42 TestNSSCertDatabase(crypto::ScopedPK11Slot public_slot, |
43 crypto::ScopedPK11Slot private_slot) | 43 crypto::ScopedPK11Slot private_slot) |
44 : NSSCertDatabaseChromeOS(std::move(public_slot), | 44 : NSSCertDatabaseChromeOS(std::move(public_slot), |
45 std::move(private_slot)) {} | 45 std::move(private_slot)) {} |
46 ~TestNSSCertDatabase() override {} | 46 ~TestNSSCertDatabase() override {} |
47 | 47 |
48 void NotifyOfCertAdded(const net::X509Certificate* cert) { | 48 void NotifyOfCertAdded(const net::X509Certificate* cert) { |
49 NSSCertDatabaseChromeOS::NotifyObserversCertDBChanged(nullptr); | 49 NSSCertDatabaseChromeOS::NotifyObserversCertDBChanged(); |
50 } | 50 } |
51 }; | 51 }; |
52 | 52 |
53 class CertLoaderTest : public testing::Test, | 53 class CertLoaderTest : public testing::Test, |
54 public CertLoader::Observer { | 54 public CertLoader::Observer { |
55 public: | 55 public: |
56 CertLoaderTest() | 56 CertLoaderTest() |
57 : cert_loader_(nullptr), certificates_loaded_events_count_(0U) {} | 57 : cert_loader_(nullptr), certificates_loaded_events_count_(0U) {} |
58 | 58 |
59 ~CertLoaderTest() override {} | 59 ~CertLoaderTest() override {} |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 ASSERT_TRUE(primary_certdb_->SetCertTrust(certs[0].get(), net::CA_CERT, | 276 ASSERT_TRUE(primary_certdb_->SetCertTrust(certs[0].get(), net::CA_CERT, |
277 net::NSSCertDatabase::TRUSTED_SSL)); | 277 net::NSSCertDatabase::TRUSTED_SSL)); |
278 | 278 |
279 // Cert trust change should trigger certificate reload in cert_loader_. | 279 // Cert trust change should trigger certificate reload in cert_loader_. |
280 ASSERT_EQ(0U, GetAndResetCertificatesLoadedEventsCount()); | 280 ASSERT_EQ(0U, GetAndResetCertificatesLoadedEventsCount()); |
281 base::RunLoop().RunUntilIdle(); | 281 base::RunLoop().RunUntilIdle(); |
282 EXPECT_EQ(1U, GetAndResetCertificatesLoadedEventsCount()); | 282 EXPECT_EQ(1U, GetAndResetCertificatesLoadedEventsCount()); |
283 } | 283 } |
284 | 284 |
285 } // namespace chromeos | 285 } // namespace chromeos |
OLD | NEW |