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

Unified Diff: net/cert/nss_profile_filter_chromeos_unittest.cc

Issue 137553004: NSS Cros multiprofile: trust roots added by a profile shouldn't apply to other profiles. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ios fix Created 6 years, 10 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_profile_filter_chromeos.cc ('k') | net/cert/test_root_certs.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/cert/nss_profile_filter_chromeos_unittest.cc
diff --git a/net/cert/nss_profile_filter_chromeos_unittest.cc b/net/cert/nss_profile_filter_chromeos_unittest.cc
index 1f6260dd4e066cd979f2a98c0e8ed089360cd2c8..60ceeb1d24f9ec29d3c66c6088c52162a676eeb4 100644
--- a/net/cert/nss_profile_filter_chromeos_unittest.cc
+++ b/net/cert/nss_profile_filter_chromeos_unittest.cc
@@ -102,12 +102,14 @@ class NSSProfileFilterChromeOSTest : public testing::Test {
NSSProfileFilterChromeOS profile_filter_1_copy_;
};
-TEST_F(NSSProfileFilterChromeOSTest, TempCertAllowed) {
+TEST_F(NSSProfileFilterChromeOSTest, TempCertNotAllowed) {
EXPECT_EQ(NULL, certs_[0]->os_cert_handle()->slot);
- EXPECT_TRUE(no_slots_profile_filter_.IsCertAllowed(certs_[0]));
- EXPECT_TRUE(profile_filter_1_.IsCertAllowed(certs_[0]));
- EXPECT_TRUE(profile_filter_1_copy_.IsCertAllowed(certs_[0]));
- EXPECT_TRUE(profile_filter_2_.IsCertAllowed(certs_[0]));
+ EXPECT_FALSE(
+ no_slots_profile_filter_.IsCertAllowed(certs_[0]->os_cert_handle()));
+ EXPECT_FALSE(profile_filter_1_.IsCertAllowed(certs_[0]->os_cert_handle()));
+ EXPECT_FALSE(
+ profile_filter_1_copy_.IsCertAllowed(certs_[0]->os_cert_handle()));
+ EXPECT_FALSE(profile_filter_2_.IsCertAllowed(certs_[0]->os_cert_handle()));
}
TEST_F(NSSProfileFilterChromeOSTest, InternalSlotAllowed) {
@@ -137,10 +139,12 @@ TEST_F(NSSProfileFilterChromeOSTest, RootCertsAllowed) {
CertificateList root_certs(ListCertsInSlot(root_certs_slot.get()));
ASSERT_FALSE(root_certs.empty());
- EXPECT_TRUE(no_slots_profile_filter_.IsCertAllowed(root_certs[0]));
- EXPECT_TRUE(profile_filter_1_.IsCertAllowed(root_certs[0]));
- EXPECT_TRUE(profile_filter_1_copy_.IsCertAllowed(root_certs[0]));
- EXPECT_TRUE(profile_filter_2_.IsCertAllowed(root_certs[0]));
+ EXPECT_TRUE(
+ no_slots_profile_filter_.IsCertAllowed(root_certs[0]->os_cert_handle()));
+ EXPECT_TRUE(profile_filter_1_.IsCertAllowed(root_certs[0]->os_cert_handle()));
+ EXPECT_TRUE(
+ profile_filter_1_copy_.IsCertAllowed(root_certs[0]->os_cert_handle()));
+ EXPECT_TRUE(profile_filter_2_.IsCertAllowed(root_certs[0]->os_cert_handle()));
}
TEST_F(NSSProfileFilterChromeOSTest, SoftwareSlots) {
@@ -171,16 +175,18 @@ TEST_F(NSSProfileFilterChromeOSTest, SoftwareSlots) {
"cert2",
PR_FALSE /* includeTrust (unused) */));
- EXPECT_FALSE(no_slots_profile_filter_.IsCertAllowed(cert_1));
- EXPECT_FALSE(no_slots_profile_filter_.IsCertAllowed(cert_2));
+ EXPECT_FALSE(
+ no_slots_profile_filter_.IsCertAllowed(cert_1->os_cert_handle()));
+ EXPECT_FALSE(
+ no_slots_profile_filter_.IsCertAllowed(cert_2->os_cert_handle()));
- EXPECT_TRUE(profile_filter_1_.IsCertAllowed(cert_1));
- EXPECT_TRUE(profile_filter_1_copy_.IsCertAllowed(cert_1));
- EXPECT_FALSE(profile_filter_1_.IsCertAllowed(cert_2));
- EXPECT_FALSE(profile_filter_1_copy_.IsCertAllowed(cert_2));
+ EXPECT_TRUE(profile_filter_1_.IsCertAllowed(cert_1->os_cert_handle()));
+ EXPECT_TRUE(profile_filter_1_copy_.IsCertAllowed(cert_1->os_cert_handle()));
+ EXPECT_FALSE(profile_filter_1_.IsCertAllowed(cert_2->os_cert_handle()));
+ EXPECT_FALSE(profile_filter_1_copy_.IsCertAllowed(cert_2->os_cert_handle()));
- EXPECT_FALSE(profile_filter_2_.IsCertAllowed(cert_1));
- EXPECT_TRUE(profile_filter_2_.IsCertAllowed(cert_2));
+ EXPECT_FALSE(profile_filter_2_.IsCertAllowed(cert_1->os_cert_handle()));
+ EXPECT_TRUE(profile_filter_2_.IsCertAllowed(cert_2->os_cert_handle()));
}
} // namespace net
« no previous file with comments | « net/cert/nss_profile_filter_chromeos.cc ('k') | net/cert/test_root_certs.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698