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

Unified Diff: chromeos/cert_loader_unittest.cc

Issue 209263002: Merge 257570 "Handle cases when user cert database has NULL slots" (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1847/src/
Patch Set: Created 6 years, 9 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 | « chromeos/cert_loader.cc ('k') | chromeos/network/onc/onc_certificate_importer_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/cert_loader_unittest.cc
===================================================================
--- chromeos/cert_loader_unittest.cc (revision 258711)
+++ chromeos/cert_loader_unittest.cc (working copy)
@@ -11,6 +11,7 @@
#include "base/run_loop.h"
#include "crypto/nss_util.h"
#include "crypto/nss_util_internal.h"
+#include "crypto/scoped_nss_types.h"
#include "net/base/net_errors.h"
#include "net/base/test_data_directory.h"
#include "net/cert/nss_cert_database_chromeos.h"
@@ -304,5 +305,19 @@
EXPECT_EQ(1U, GetAndResetCertificatesLoadedEventsCount());
}
+TEST_F(CertLoaderTest, DatabaseWithUnsetSlots) {
+ primary_db_.reset(new net::NSSCertDatabaseChromeOS(crypto::ScopedPK11Slot(),
+ crypto::ScopedPK11Slot()));
+ primary_db_->SetSlowTaskRunnerForTest(message_loop_.message_loop_proxy());
+ cert_loader_->StartWithNSSDB(primary_db_.get());
+
+ base::RunLoop().RunUntilIdle();
+ EXPECT_EQ(1u, GetAndResetCertificatesLoadedEventsCount());
+
+ EXPECT_TRUE(cert_loader_->certificates_loaded());
+ EXPECT_EQ(-1, cert_loader_->TPMTokenSlotID());
+ EXPECT_FALSE(cert_loader_->IsHardwareBacked());
+}
+
} // namespace
} // namespace chromeos
« no previous file with comments | « chromeos/cert_loader.cc ('k') | chromeos/network/onc/onc_certificate_importer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698