| 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 "extensions/browser/api/socket/tls_socket.h" | 5 #include "extensions/browser/api/socket/tls_socket.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <deque> | 10 #include <deque> |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 const StringPiece&, | 67 const StringPiece&, |
| 68 unsigned char*, | 68 unsigned char*, |
| 69 unsigned int)); | 69 unsigned int)); |
| 70 MOCK_METHOD1(GetTLSUniqueChannelBinding, int(std::string*)); | 70 MOCK_METHOD1(GetTLSUniqueChannelBinding, int(std::string*)); |
| 71 MOCK_METHOD1(GetSSLCertRequestInfo, void(net::SSLCertRequestInfo*)); | 71 MOCK_METHOD1(GetSSLCertRequestInfo, void(net::SSLCertRequestInfo*)); |
| 72 MOCK_CONST_METHOD1(GetNextProto, | 72 MOCK_CONST_METHOD1(GetNextProto, |
| 73 net::SSLClientSocket::NextProtoStatus(std::string*)); | 73 net::SSLClientSocket::NextProtoStatus(std::string*)); |
| 74 MOCK_CONST_METHOD0(GetUnverifiedServerCertificateChain, | 74 MOCK_CONST_METHOD0(GetUnverifiedServerCertificateChain, |
| 75 scoped_refptr<net::X509Certificate>()); | 75 scoped_refptr<net::X509Certificate>()); |
| 76 MOCK_CONST_METHOD0(GetChannelIDService, net::ChannelIDService*()); | 76 MOCK_CONST_METHOD0(GetChannelIDService, net::ChannelIDService*()); |
| 77 MOCK_METHOD2(GetSignedEKMForTokenBinding, |
| 78 int(crypto::ECPrivateKey*, std::vector<uint8_t>*)); |
| 77 MOCK_CONST_METHOD0(GetSSLFailureState, net::SSLFailureState()); | 79 MOCK_CONST_METHOD0(GetSSLFailureState, net::SSLFailureState()); |
| 78 bool IsConnected() const override { return true; } | 80 bool IsConnected() const override { return true; } |
| 79 | 81 |
| 80 private: | 82 private: |
| 81 DISALLOW_COPY_AND_ASSIGN(MockSSLClientSocket); | 83 DISALLOW_COPY_AND_ASSIGN(MockSSLClientSocket); |
| 82 }; | 84 }; |
| 83 | 85 |
| 84 class MockTCPSocket : public net::TCPClientSocket { | 86 class MockTCPSocket : public net::TCPClientSocket { |
| 85 public: | 87 public: |
| 86 explicit MockTCPSocket(const net::AddressList& address_list) | 88 explicit MockTCPSocket(const net::AddressList& address_list) |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 313 total_bytes_written += amount_written_invocation; | 315 total_bytes_written += amount_written_invocation; |
| 314 cb.first.Run(amount_written_invocation); | 316 cb.first.Run(amount_written_invocation); |
| 315 } | 317 } |
| 316 | 318 |
| 317 ASSERT_EQ(total_bytes_requested, total_bytes_written) | 319 ASSERT_EQ(total_bytes_requested, total_bytes_written) |
| 318 << "There should be exactly as many bytes written as originally " | 320 << "There should be exactly as many bytes written as originally " |
| 319 << "requested to Write()."; | 321 << "requested to Write()."; |
| 320 } | 322 } |
| 321 | 323 |
| 322 } // namespace extensions | 324 } // namespace extensions |
| OLD | NEW |