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 <deque> | 7 #include <deque> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
59 const StringPiece&, | 59 const StringPiece&, |
60 unsigned char*, | 60 unsigned char*, |
61 unsigned int)); | 61 unsigned int)); |
62 MOCK_METHOD1(GetTLSUniqueChannelBinding, int(std::string*)); | 62 MOCK_METHOD1(GetTLSUniqueChannelBinding, int(std::string*)); |
63 MOCK_METHOD1(GetSSLCertRequestInfo, void(net::SSLCertRequestInfo*)); | 63 MOCK_METHOD1(GetSSLCertRequestInfo, void(net::SSLCertRequestInfo*)); |
64 MOCK_CONST_METHOD1(GetNextProto, | 64 MOCK_CONST_METHOD1(GetNextProto, |
65 net::SSLClientSocket::NextProtoStatus(std::string*)); | 65 net::SSLClientSocket::NextProtoStatus(std::string*)); |
66 MOCK_CONST_METHOD0(GetUnverifiedServerCertificateChain, | 66 MOCK_CONST_METHOD0(GetUnverifiedServerCertificateChain, |
67 scoped_refptr<net::X509Certificate>()); | 67 scoped_refptr<net::X509Certificate>()); |
68 MOCK_CONST_METHOD0(GetChannelIDService, net::ChannelIDService*()); | 68 MOCK_CONST_METHOD0(GetChannelIDService, net::ChannelIDService*()); |
69 MOCK_CONST_METHOD0(GetSSLFailureState, net::SSLFailureState()); | |
Ryan Sleevi
2015/05/14 23:30:20
Not your fault, but a lot of this API is all "Dang
davidben
2015/05/15 18:00:23
Acknowledged. (I'm assuming there's nothing really
| |
69 bool IsConnected() const override { return true; } | 70 bool IsConnected() const override { return true; } |
70 | 71 |
71 private: | 72 private: |
72 DISALLOW_COPY_AND_ASSIGN(MockSSLClientSocket); | 73 DISALLOW_COPY_AND_ASSIGN(MockSSLClientSocket); |
73 }; | 74 }; |
74 | 75 |
75 class MockTCPSocket : public net::TCPClientSocket { | 76 class MockTCPSocket : public net::TCPClientSocket { |
76 public: | 77 public: |
77 explicit MockTCPSocket(const net::AddressList& address_list) | 78 explicit MockTCPSocket(const net::AddressList& address_list) |
78 : net::TCPClientSocket(address_list, NULL, net::NetLog::Source()) {} | 79 : net::TCPClientSocket(address_list, NULL, net::NetLog::Source()) {} |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
304 total_bytes_written += amount_written_invocation; | 305 total_bytes_written += amount_written_invocation; |
305 cb.first.Run(amount_written_invocation); | 306 cb.first.Run(amount_written_invocation); |
306 } | 307 } |
307 | 308 |
308 ASSERT_EQ(total_bytes_requested, total_bytes_written) | 309 ASSERT_EQ(total_bytes_requested, total_bytes_written) |
309 << "There should be exactly as many bytes written as originally " | 310 << "There should be exactly as many bytes written as originally " |
310 << "requested to Write()."; | 311 << "requested to Write()."; |
311 } | 312 } |
312 | 313 |
313 } // namespace extensions | 314 } // namespace extensions |
OLD | NEW |