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

Unified Diff: net/cert/nss_cert_database_chromeos_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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/cert/nss_cert_database.cc ('k') | net/quic/chromium/quic_stream_factory.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/cert/nss_cert_database_chromeos_unittest.cc
diff --git a/net/cert/nss_cert_database_chromeos_unittest.cc b/net/cert/nss_cert_database_chromeos_unittest.cc
index 05678df5ae743ab927253609535d9b23b41893c4..9cd226411e2939163de34f3c37cbdc004a0e2853 100644
--- a/net/cert/nss_cert_database_chromeos_unittest.cc
+++ b/net/cert/nss_cert_database_chromeos_unittest.cc
@@ -85,13 +85,7 @@ class NSSCertDatabaseChromeOSTest : public testing::Test,
}
// CertDatabase::Observer:
- void OnCertAdded(const X509Certificate* cert) override {
- added_.push_back(cert ? cert->os_cert_handle() : NULL);
- }
-
- void OnCertRemoved(const X509Certificate* cert) override {}
-
- void OnCACertChanged(const X509Certificate* cert) override {
+ void OnCertDBChanged(const X509Certificate* cert) override {
added_ca_.push_back(cert ? cert->os_cert_handle() : NULL);
}
@@ -99,7 +93,6 @@ class NSSCertDatabaseChromeOSTest : public testing::Test,
bool observer_added_;
// Certificates that were passed to the CertDatabase observers.
std::vector<CERTCertificate*> added_ca_;
- std::vector<CERTCertificate*> added_;
crypto::ScopedTestNSSChromeOSUser user_1_;
crypto::ScopedTestNSSChromeOSUser user_2_;
@@ -180,13 +173,12 @@ TEST_F(NSSCertDatabaseChromeOSTest, ImportCACerts) {
// Run the message loop so the observer notifications get processed.
base::RunLoop().RunUntilIdle();
- // Should have gotten two OnCACertChanged notifications.
+ // Should have gotten two OnCertDBChanged notifications.
ASSERT_EQ(2U, added_ca_.size());
// TODO(mattm): make NSSCertDatabase actually pass the cert to the callback,
// and enable these checks:
// EXPECT_EQ(certs_1[0]->os_cert_handle(), added_ca_[0]);
// EXPECT_EQ(certs_2[0]->os_cert_handle(), added_ca_[1]);
- EXPECT_EQ(0U, added_.size());
// Tests that the new certs are loaded by async ListCerts method.
CertificateList user_1_certlist_async;
@@ -251,7 +243,6 @@ TEST_F(NSSCertDatabaseChromeOSTest, ImportServerCert) {
// TODO(mattm): ImportServerCert doesn't actually cause any observers to
// fire. Is that correct?
EXPECT_EQ(0U, added_ca_.size());
- EXPECT_EQ(0U, added_.size());
// Tests that the new certs are loaded by async ListCerts method.
CertificateList user_1_certlist_async;
« no previous file with comments | « net/cert/nss_cert_database.cc ('k') | net/quic/chromium/quic_stream_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698