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 "net/cert/nss_profile_filter_chromeos.h" | 5 #include "net/cert/nss_profile_filter_chromeos.h" |
6 | 6 |
7 #include <cert.h> | 7 #include <cert.h> |
8 #include <pk11pub.h> | 8 #include <pk11pub.h> |
9 #include <secmod.h> | 9 #include <secmod.h> |
10 | 10 |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 std::sort(result.begin(), result.end(), X509Certificate::LessThan()); | 51 std::sort(result.begin(), result.end(), X509Certificate::LessThan()); |
52 return result; | 52 return result; |
53 } | 53 } |
54 | 54 |
55 } | 55 } |
56 | 56 |
57 class NSSProfileFilterChromeOSTest : public testing::Test { | 57 class NSSProfileFilterChromeOSTest : public testing::Test { |
58 public: | 58 public: |
59 NSSProfileFilterChromeOSTest() : user_1_("user1"), user_2_("user2") {} | 59 NSSProfileFilterChromeOSTest() : user_1_("user1"), user_2_("user2") {} |
60 | 60 |
61 virtual void SetUp() override { | 61 void SetUp() override { |
62 ASSERT_TRUE(system_slot_user_.is_open()); | 62 ASSERT_TRUE(system_slot_user_.is_open()); |
63 ASSERT_TRUE(user_1_.constructed_successfully()); | 63 ASSERT_TRUE(user_1_.constructed_successfully()); |
64 ASSERT_TRUE(user_2_.constructed_successfully()); | 64 ASSERT_TRUE(user_2_.constructed_successfully()); |
65 user_1_.FinishInit(); | 65 user_1_.FinishInit(); |
66 user_2_.FinishInit(); | 66 user_2_.FinishInit(); |
67 | 67 |
68 // TODO(mattm): more accurately test public/private slot filtering somehow. | 68 // TODO(mattm): more accurately test public/private slot filtering somehow. |
69 // (The slots used to initialize a profile filter should be separate slots | 69 // (The slots used to initialize a profile filter should be separate slots |
70 // in separate modules, while ScopedTestNSSChromeOSUser uses the same slot | 70 // in separate modules, while ScopedTestNSSChromeOSUser uses the same slot |
71 // for both.) | 71 // for both.) |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 EXPECT_TRUE(profile_filter_1_.IsCertAllowed(system_cert->os_cert_handle())); | 210 EXPECT_TRUE(profile_filter_1_.IsCertAllowed(system_cert->os_cert_handle())); |
211 EXPECT_TRUE( | 211 EXPECT_TRUE( |
212 profile_filter_1_copy_.IsCertAllowed(system_cert->os_cert_handle())); | 212 profile_filter_1_copy_.IsCertAllowed(system_cert->os_cert_handle())); |
213 | 213 |
214 EXPECT_FALSE(profile_filter_2_.IsCertAllowed(cert_1->os_cert_handle())); | 214 EXPECT_FALSE(profile_filter_2_.IsCertAllowed(cert_1->os_cert_handle())); |
215 EXPECT_TRUE(profile_filter_2_.IsCertAllowed(cert_2->os_cert_handle())); | 215 EXPECT_TRUE(profile_filter_2_.IsCertAllowed(cert_2->os_cert_handle())); |
216 EXPECT_FALSE(profile_filter_2_.IsCertAllowed(system_cert->os_cert_handle())); | 216 EXPECT_FALSE(profile_filter_2_.IsCertAllowed(system_cert->os_cert_handle())); |
217 } | 217 } |
218 | 218 |
219 } // namespace net | 219 } // namespace net |
OLD | NEW |