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 #ifndef CHROME_BROWSER_EXTENSIONS_API_SOCKET_MOCK_TCP_CLIENT_SOCKET_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_SOCKET_MOCK_TCP_CLIENT_SOCKET_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_API_SOCKET_MOCK_TCP_CLIENT_SOCKET_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_SOCKET_MOCK_TCP_CLIENT_SOCKET_H_ |
7 | 7 |
8 #include "net/log/net_log_source.h" | 8 #include "net/log/net_log_source.h" |
9 #include "net/log/net_log_with_source.h" | 9 #include "net/log/net_log_with_source.h" |
10 #include "net/socket/tcp_client_socket.h" | 10 #include "net/socket/tcp_client_socket.h" |
11 #include "testing/gmock/include/gmock/gmock.h" | 11 #include "testing/gmock/include/gmock/gmock.h" |
12 | 12 |
13 namespace extensions { | 13 namespace extensions { |
14 | 14 |
15 class MockTCPClientSocket : public net::TCPClientSocket { | 15 class MockTCPClientSocket : public net::TCPClientSocket { |
16 public: | 16 public: |
17 MockTCPClientSocket(); | 17 MockTCPClientSocket(); |
18 virtual ~MockTCPClientSocket(); | 18 virtual ~MockTCPClientSocket(); |
19 | 19 |
20 // Copied from MockTCPClientSocket in blimp/net/test_common.h | |
21 MOCK_METHOD3(Read, int(net::IOBuffer*, int, const net::CompletionCallback&)); | 20 MOCK_METHOD3(Read, int(net::IOBuffer*, int, const net::CompletionCallback&)); |
22 MOCK_METHOD3(Write, int(net::IOBuffer*, int, const net::CompletionCallback&)); | 21 MOCK_METHOD3(Write, int(net::IOBuffer*, int, const net::CompletionCallback&)); |
23 MOCK_METHOD1(SetReceiveBufferSize, int(int32_t)); | 22 MOCK_METHOD1(SetReceiveBufferSize, int(int32_t)); |
24 MOCK_METHOD1(SetSendBufferSize, int(int32_t)); | 23 MOCK_METHOD1(SetSendBufferSize, int(int32_t)); |
25 MOCK_METHOD1(Connect, int(const net::CompletionCallback&)); | 24 MOCK_METHOD1(Connect, int(const net::CompletionCallback&)); |
26 MOCK_METHOD0(Disconnect, void()); | 25 MOCK_METHOD0(Disconnect, void()); |
27 MOCK_CONST_METHOD0(IsConnected, bool()); | 26 MOCK_CONST_METHOD0(IsConnected, bool()); |
28 MOCK_CONST_METHOD0(IsConnectedAndIdle, bool()); | 27 MOCK_CONST_METHOD0(IsConnectedAndIdle, bool()); |
29 MOCK_CONST_METHOD1(GetPeerAddress, int(net::IPEndPoint*)); | 28 MOCK_CONST_METHOD1(GetPeerAddress, int(net::IPEndPoint*)); |
30 MOCK_CONST_METHOD1(GetLocalAddress, int(net::IPEndPoint*)); | 29 MOCK_CONST_METHOD1(GetLocalAddress, int(net::IPEndPoint*)); |
(...skipping 21 matching lines...) Expand all Loading... |
52 MockTCPClientSocket::MockTCPClientSocket() | 51 MockTCPClientSocket::MockTCPClientSocket() |
53 : TCPClientSocket(net::AddressList(), | 52 : TCPClientSocket(net::AddressList(), |
54 nullptr, | 53 nullptr, |
55 nullptr, | 54 nullptr, |
56 net::NetLogSource()) {} | 55 net::NetLogSource()) {} |
57 MockTCPClientSocket::~MockTCPClientSocket() {} | 56 MockTCPClientSocket::~MockTCPClientSocket() {} |
58 | 57 |
59 } // namespace extensions | 58 } // namespace extensions |
60 | 59 |
61 #endif // CHROME_BROWSER_EXTENSIONS_API_SOCKET_MOCK_TCP_CLIENT_SOCKET_H_ | 60 #endif // CHROME_BROWSER_EXTENSIONS_API_SOCKET_MOCK_TCP_CLIENT_SOCKET_H_ |
OLD | NEW |