| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/internal/cert_issuer_source_aia.h" | 5 #include "net/cert/internal/cert_issuer_source_aia.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "net/cert/cert_net_fetcher.h" | 8 #include "net/cert/cert_net_fetcher.h" |
| 9 #include "net/cert/internal/parsed_certificate.h" | 9 #include "net/cert/internal/parsed_certificate.h" |
| 10 #include "net/cert/internal/test_helpers.h" | 10 #include "net/cert/internal/test_helpers.h" |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 ADD_FAILURE() << "NotCalled was called"; | 159 ADD_FAILURE() << "NotCalled was called"; |
| 160 } | 160 } |
| 161 | 161 |
| 162 // CertIssuerSourceAia does not return results for SyncGetIssuersOf. | 162 // CertIssuerSourceAia does not return results for SyncGetIssuersOf. |
| 163 TEST(CertIssuerSourceAiaTest, NoSyncResults) { | 163 TEST(CertIssuerSourceAiaTest, NoSyncResults) { |
| 164 scoped_refptr<ParsedCertificate> cert; | 164 scoped_refptr<ParsedCertificate> cert; |
| 165 ASSERT_TRUE(ReadTestCert("target_two_aia.pem", &cert)); | 165 ASSERT_TRUE(ReadTestCert("target_two_aia.pem", &cert)); |
| 166 | 166 |
| 167 StrictMock<MockCertNetFetcherImpl> mock_fetcher; | 167 StrictMock<MockCertNetFetcherImpl> mock_fetcher; |
| 168 CertIssuerSourceAia aia_source(&mock_fetcher); | 168 CertIssuerSourceAia aia_source(&mock_fetcher); |
| 169 std::vector<scoped_refptr<ParsedCertificate>> issuers; | 169 ParsedCertificateList issuers; |
| 170 aia_source.SyncGetIssuersOf(cert.get(), &issuers); | 170 aia_source.SyncGetIssuersOf(cert.get(), &issuers); |
| 171 EXPECT_EQ(0U, issuers.size()); | 171 EXPECT_EQ(0U, issuers.size()); |
| 172 } | 172 } |
| 173 | 173 |
| 174 // If the AuthorityInfoAccess extension is not present, AsyncGetIssuersOf should | 174 // If the AuthorityInfoAccess extension is not present, AsyncGetIssuersOf should |
| 175 // synchronously indicate no results. | 175 // synchronously indicate no results. |
| 176 TEST(CertIssuerSourceAiaTest, NoAia) { | 176 TEST(CertIssuerSourceAiaTest, NoAia) { |
| 177 scoped_refptr<ParsedCertificate> cert; | 177 scoped_refptr<ParsedCertificate> cert; |
| 178 ASSERT_TRUE(ReadTestCert("target_no_aia.pem", &cert)); | 178 ASSERT_TRUE(ReadTestCert("target_no_aia.pem", &cert)); |
| 179 | 179 |
| (...skipping 731 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 911 EXPECT_TRUE(req_manager5->is_request_alive()); | 911 EXPECT_TRUE(req_manager5->is_request_alive()); |
| 912 | 912 |
| 913 // Sixth URL should not have created a request. | 913 // Sixth URL should not have created a request. |
| 914 EXPECT_FALSE( | 914 EXPECT_FALSE( |
| 915 mock_fetcher.GetRequestManagerForURL(GURL("http://url-for-aia6/I6.foo"))); | 915 mock_fetcher.GetRequestManagerForURL(GURL("http://url-for-aia6/I6.foo"))); |
| 916 } | 916 } |
| 917 | 917 |
| 918 } // namespace | 918 } // namespace |
| 919 | 919 |
| 920 } // namespace net | 920 } // namespace net |
| OLD | NEW |