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" |
| 9 #include "net/log/net_log_with_source.h" |
8 #include "net/socket/tcp_client_socket.h" | 10 #include "net/socket/tcp_client_socket.h" |
9 #include "testing/gmock/include/gmock/gmock.h" | 11 #include "testing/gmock/include/gmock/gmock.h" |
10 | 12 |
11 namespace extensions { | 13 namespace extensions { |
12 | 14 |
13 class MockTCPClientSocket : public net::TCPClientSocket { | 15 class MockTCPClientSocket : public net::TCPClientSocket { |
14 public: | 16 public: |
15 MockTCPClientSocket(); | 17 MockTCPClientSocket(); |
16 virtual ~MockTCPClientSocket(); | 18 virtual ~MockTCPClientSocket(); |
17 | 19 |
(...skipping 26 matching lines...) Expand all Loading... |
44 // Methods specific to MockTCPClientSocket | 46 // Methods specific to MockTCPClientSocket |
45 MOCK_METHOD1(Bind, int(const net::IPEndPoint&)); | 47 MOCK_METHOD1(Bind, int(const net::IPEndPoint&)); |
46 MOCK_METHOD2(SetKeepAlive, bool(bool, int)); | 48 MOCK_METHOD2(SetKeepAlive, bool(bool, int)); |
47 MOCK_METHOD1(SetNoDelay, bool(bool)); | 49 MOCK_METHOD1(SetNoDelay, bool(bool)); |
48 }; | 50 }; |
49 | 51 |
50 MockTCPClientSocket::MockTCPClientSocket() | 52 MockTCPClientSocket::MockTCPClientSocket() |
51 : TCPClientSocket(net::AddressList(), | 53 : TCPClientSocket(net::AddressList(), |
52 nullptr, | 54 nullptr, |
53 nullptr, | 55 nullptr, |
54 net::NetLog::Source()) {} | 56 net::NetLogSource()) {} |
55 MockTCPClientSocket::~MockTCPClientSocket() {} | 57 MockTCPClientSocket::~MockTCPClientSocket() {} |
56 | 58 |
57 } // namespace extensions | 59 } // namespace extensions |
58 | 60 |
59 #endif // CHROME_BROWSER_EXTENSIONS_API_SOCKET_MOCK_TCP_CLIENT_SOCKET_H_ | 61 #endif // CHROME_BROWSER_EXTENSIONS_API_SOCKET_MOCK_TCP_CLIENT_SOCKET_H_ |
OLD | NEW |