Bob Beck | 9c0f22c | 2023-06-29 11:18:37 -0600 | [diff] [blame] | 1 | From 0a1d630dbc33f63009aabb4907a1dbeb4c934415 Mon Sep 17 00:00:00 2001 |
Bob Beck | bc97b7a | 2023-04-18 08:35:15 -0600 | [diff] [blame] | 2 | From: Bob Beck <bbe@google.com> |
| 3 | Date: Fri, 2 Jun 2023 11:08:50 +0200 |
Bob Beck | 9c0f22c | 2023-06-29 11:18:37 -0600 | [diff] [blame] | 4 | Subject: [PATCH 2/2] disable path builder tests with unsupported dependencies |
Bob Beck | bc97b7a | 2023-04-18 08:35:15 -0600 | [diff] [blame] | 5 | |
| 6 | --- |
| 7 | net/cert/pki/path_builder_unittest.cc | 12 ++++++++++++ |
| 8 | 1 file changed, 12 insertions(+) |
| 9 | |
| 10 | diff --git a/net/cert/pki/path_builder_unittest.cc b/net/cert/pki/path_builder_unittest.cc |
| 11 | index d2cf0626cd474..112d0cafd811b 100644 |
| 12 | --- a/net/cert/pki/path_builder_unittest.cc |
| 13 | +++ b/net/cert/pki/path_builder_unittest.cc |
| 14 | @@ -34,6 +34,7 @@ namespace net { |
| 15 | |
| 16 | namespace { |
| 17 | |
| 18 | +#if !defined(_BORINGSSL_LIBPKI_) |
| 19 | using ::testing::_; |
| 20 | using ::testing::ElementsAre; |
| 21 | using ::testing::Exactly; |
| 22 | @@ -43,6 +44,7 @@ using ::testing::Return; |
| 23 | using ::testing::SaveArg; |
| 24 | using ::testing::SetArgPointee; |
| 25 | using ::testing::StrictMock; |
| 26 | +#endif // !_BORINGSSL_LIBPKI_ |
| 27 | |
| 28 | class TestPathBuilderDelegate : public SimplePathBuilderDelegate { |
| 29 | public: |
| 30 | @@ -161,6 +163,7 @@ class AsyncCertIssuerSourceStatic : public CertIssuerSource { |
| 31 | } |
| 32 | |
| 33 | const void* kKey = &kKey; |
| 34 | +#if !defined(_BORINGSSL_LIBPKI_) |
| 35 | class TrustStoreThatStoresUserData : public TrustStore { |
| 36 | public: |
| 37 | class Data : public base::SupportsUserData::Data { |
| 38 | @@ -202,6 +205,7 @@ TEST(PathBuilderResultUserDataTest, ModifyUserDataInConstructor) { |
| 39 | ASSERT_TRUE(data); |
| 40 | EXPECT_EQ(1234, data->value); |
| 41 | } |
| 42 | +#endif // !_BORINGSSL_LIBPKI_ |
| 43 | |
| 44 | class PathBuilderMultiRootTest : public ::testing::Test { |
| 45 | public: |
| 46 | @@ -1566,6 +1570,7 @@ TEST_F(PathBuilderKeyRolloverTest, TestDuplicateIntermediateAndRoot) { |
| 47 | EXPECT_EQ(newroot_->der_cert(), path.certs[2]->der_cert()); |
| 48 | } |
| 49 | |
| 50 | +#if !defined(_BORINGSSL_LIBPKI_) |
| 51 | class MockCertIssuerSourceRequest : public CertIssuerSource::Request { |
| 52 | public: |
| 53 | MOCK_METHOD2(GetNext, void(ParsedCertificateList*, base::SupportsUserData*)); |
| 54 | @@ -1578,6 +1583,7 @@ class MockCertIssuerSource : public CertIssuerSource { |
| 55 | MOCK_METHOD2(AsyncGetIssuersOf, |
| 56 | void(const ParsedCertificate*, std::unique_ptr<Request>*)); |
| 57 | }; |
| 58 | +#endif // !_BORINGSSL_LIBPKI_ |
| 59 | |
| 60 | // Helper class to pass the Request to the PathBuilder when it calls |
| 61 | // AsyncGetIssuersOf. (GoogleMock has a ByMove helper, but it apparently can |
| 62 | @@ -1613,6 +1619,7 @@ class AppendCertToList { |
| 63 | std::shared_ptr<const ParsedCertificate> cert_; |
| 64 | }; |
| 65 | |
| 66 | +#if !defined(_BORINGSSL_LIBPKI_) |
| 67 | // Test that a single CertIssuerSource returning multiple async batches of |
| 68 | // issuers is handled correctly. Due to the StrictMocks, it also tests that path |
| 69 | // builder does not request issuers of certs that it shouldn't. |
| 70 | @@ -1782,6 +1789,7 @@ TEST_F(PathBuilderKeyRolloverTest, TestDuplicateAsyncIntermediates) { |
| 71 | EXPECT_EQ(newintermediate_, path1.certs[1]); |
| 72 | EXPECT_EQ(newroot_, path1.certs[2]); |
| 73 | } |
| 74 | +#endif // !_BORINGSSL_LIBPKI_ |
| 75 | |
| 76 | class PathBuilderSimpleChainTest : public ::testing::Test { |
| 77 | public: |
| 78 | @@ -1936,6 +1944,7 @@ class CertPathBuilderDelegateBase : public SimplePathBuilderDelegate { |
| 79 | } |
| 80 | }; |
| 81 | |
| 82 | +#if !defined(_BORINGSSL_LIBPKI_) |
| 83 | class MockPathBuilderDelegate : public CertPathBuilderDelegateBase { |
| 84 | public: |
| 85 | MOCK_METHOD2(CheckPathAfterVerification, |
| 86 | @@ -1951,6 +1960,7 @@ TEST_F(PathBuilderCheckPathAfterVerificationTest, NoOpToValidPath) { |
| 87 | CertPathBuilder::Result result = RunPathBuilder(nullptr, &delegate); |
| 88 | EXPECT_TRUE(result.HasValidPath()); |
| 89 | } |
| 90 | +#endif // !_BORINGSSL_LIBPKI_ |
| 91 | |
| 92 | DEFINE_CERT_ERROR_ID(kWarningFromDelegate, "Warning from delegate"); |
| 93 | |
| 94 | @@ -2002,6 +2012,7 @@ TEST_F(PathBuilderCheckPathAfterVerificationTest, AddsErrorToValidPath) { |
| 95 | EXPECT_TRUE(cert2_errors->ContainsError(kErrorFromDelegate)); |
| 96 | } |
| 97 | |
| 98 | +#if !defined(_BORINGSSL_LIBPKI_) |
| 99 | TEST_F(PathBuilderCheckPathAfterVerificationTest, NoopToAlreadyInvalidPath) { |
| 100 | StrictMock<MockPathBuilderDelegate> delegate; |
| 101 | // Just verify that the hook is called (on an invalid path). |
| 102 | @@ -2034,6 +2045,7 @@ TEST_F(PathBuilderCheckPathAfterVerificationTest, SetsDelegateData) { |
| 103 | |
| 104 | EXPECT_EQ(0xB33F, data->value); |
| 105 | } |
| 106 | +#endif // !_BORINGSSL_LIBPKI_ |
| 107 | |
| 108 | TEST(PathBuilderPrioritizationTest, DatePrioritization) { |
| 109 | std::string test_dir = |
| 110 | -- |
| 111 | 2.41.0.162.gfafddb0af9-goog |
| 112 | |