Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(761)

Side by Side Diff: chromeos/cert_loader_unittest.cc

Issue 2363653002: Cleanup unreachable cert adding code (Closed)
Patch Set: Rebased Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chromeos/cert_loader.cc ('k') | components/infobars/core/infobar_delegate.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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::NotifyObserversOfCertAdded(cert); 49 NSSCertDatabaseChromeOS::NotifyObserversCertDBChanged(nullptr);
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 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 ASSERT_TRUE(primary_certdb_->SetCertTrust(certs[0].get(), net::CA_CERT, 277 ASSERT_TRUE(primary_certdb_->SetCertTrust(certs[0].get(), net::CA_CERT,
278 net::NSSCertDatabase::TRUSTED_SSL)); 278 net::NSSCertDatabase::TRUSTED_SSL));
279 279
280 // Cert trust change should trigger certificate reload in cert_loader_. 280 // Cert trust change should trigger certificate reload in cert_loader_.
281 ASSERT_EQ(0U, GetAndResetCertificatesLoadedEventsCount()); 281 ASSERT_EQ(0U, GetAndResetCertificatesLoadedEventsCount());
282 base::RunLoop().RunUntilIdle(); 282 base::RunLoop().RunUntilIdle();
283 EXPECT_EQ(1U, GetAndResetCertificatesLoadedEventsCount()); 283 EXPECT_EQ(1U, GetAndResetCertificatesLoadedEventsCount());
284 } 284 }
285 285
286 } // namespace chromeos 286 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromeos/cert_loader.cc ('k') | components/infobars/core/infobar_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698