| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/socket/ssl_client_socket.h" | 5 #include "net/socket/ssl_client_socket.h" |
| 6 | 6 |
| 7 #include <errno.h> | 7 #include <errno.h> |
| 8 #include <string.h> | 8 #include <string.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 796 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 807 | 807 |
| 808 // A mock ExpectCTReporter that remembers the latest violation that was | 808 // A mock ExpectCTReporter that remembers the latest violation that was |
| 809 // reported and the number of violations reported. | 809 // reported and the number of violations reported. |
| 810 class MockExpectCTReporter : public TransportSecurityState::ExpectCTReporter { | 810 class MockExpectCTReporter : public TransportSecurityState::ExpectCTReporter { |
| 811 public: | 811 public: |
| 812 MockExpectCTReporter() : num_failures_(0) {} | 812 MockExpectCTReporter() : num_failures_(0) {} |
| 813 ~MockExpectCTReporter() override {} | 813 ~MockExpectCTReporter() override {} |
| 814 | 814 |
| 815 void OnExpectCTFailed(const HostPortPair& host_port_pair, | 815 void OnExpectCTFailed(const HostPortPair& host_port_pair, |
| 816 const GURL& report_uri, | 816 const GURL& report_uri, |
| 817 base::Time expiration, |
| 817 const X509Certificate* validated_certificate_chain, | 818 const X509Certificate* validated_certificate_chain, |
| 818 const X509Certificate* served_certificate_chain, | 819 const X509Certificate* served_certificate_chain, |
| 819 const SignedCertificateTimestampAndStatusList& | 820 const SignedCertificateTimestampAndStatusList& |
| 820 signed_certificate_timestamps) override { | 821 signed_certificate_timestamps) override { |
| 821 num_failures_++; | 822 num_failures_++; |
| 822 host_port_pair_ = host_port_pair; | 823 host_port_pair_ = host_port_pair; |
| 823 report_uri_ = report_uri; | 824 report_uri_ = report_uri; |
| 824 served_certificate_chain_ = served_certificate_chain; | 825 served_certificate_chain_ = served_certificate_chain; |
| 825 validated_certificate_chain_ = validated_certificate_chain; | 826 validated_certificate_chain_ = validated_certificate_chain; |
| 826 signed_certificate_timestamps_ = signed_certificate_timestamps; | 827 signed_certificate_timestamps_ = signed_certificate_timestamps; |
| (...skipping 3160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3987 // The read buffer should be released. | 3988 // The read buffer should be released. |
| 3988 StreamSocket::SocketMemoryStats stats; | 3989 StreamSocket::SocketMemoryStats stats; |
| 3989 client->DumpMemoryStats(&stats); | 3990 client->DumpMemoryStats(&stats); |
| 3990 EXPECT_EQ(0u, stats.buffer_size); | 3991 EXPECT_EQ(0u, stats.buffer_size); |
| 3991 EXPECT_EQ(1u, stats.cert_count); | 3992 EXPECT_EQ(1u, stats.cert_count); |
| 3992 EXPECT_LT(0u, stats.cert_size); | 3993 EXPECT_LT(0u, stats.cert_size); |
| 3993 EXPECT_EQ(stats.cert_size, stats.total_size); | 3994 EXPECT_EQ(stats.cert_size, stats.total_size); |
| 3994 } | 3995 } |
| 3995 | 3996 |
| 3996 } // namespace net | 3997 } // namespace net |
| OLD | NEW |