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 #ifndef DEVICE_BLUETOOTH_TEST_MOCK_BLUETOOTH_SOCKET_H_ | 5 #ifndef DEVICE_BLUETOOTH_TEST_MOCK_BLUETOOTH_SOCKET_H_ |
6 #define DEVICE_BLUETOOTH_TEST_MOCK_BLUETOOTH_SOCKET_H_ | 6 #define DEVICE_BLUETOOTH_TEST_MOCK_BLUETOOTH_SOCKET_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "device/bluetooth/bluetooth_socket.h" | 10 #include "device/bluetooth/bluetooth_socket.h" |
11 #include "net/base/io_buffer.h" | 11 #include "net/base/io_buffer.h" |
12 #include "testing/gmock/include/gmock/gmock.h" | 12 #include "testing/gmock/include/gmock/gmock.h" |
13 | 13 |
14 namespace device { | 14 namespace device { |
15 | 15 |
16 class MockBluetoothSocket : public BluetoothSocket { | 16 class MockBluetoothSocket : public BluetoothSocket { |
17 public: | 17 public: |
18 MockBluetoothSocket(); | 18 MockBluetoothSocket(); |
19 MOCK_METHOD0(Close, void()); | 19 MOCK_METHOD0(Close, void()); |
20 MOCK_METHOD1(Disconnect, void(const base::Closure& callback)); | 20 MOCK_METHOD1(Disconnect, void(const base::Closure& success_callback)); |
21 MOCK_METHOD3(Receive, | 21 MOCK_METHOD3(Receive, |
22 void(int count, | 22 void(int count, |
23 const ReceiveCompletionCallback& success_callback, | 23 const ReceiveCompletionCallback& success_callback, |
24 const ReceiveErrorCompletionCallback& error_callback)); | 24 const ReceiveErrorCompletionCallback& error_callback)); |
25 MOCK_METHOD4(Send, | 25 MOCK_METHOD4(Send, |
26 void(scoped_refptr<net::IOBuffer> buffer, | 26 void(scoped_refptr<net::IOBuffer> buffer, |
27 int buffer_size, | 27 int buffer_size, |
28 const SendCompletionCallback& success_callback, | 28 const SendCompletionCallback& success_callback, |
29 const ErrorCompletionCallback& error_callback)); | 29 const ErrorCompletionCallback& error_callback)); |
30 | 30 |
31 protected: | 31 protected: |
32 virtual ~MockBluetoothSocket(); | 32 virtual ~MockBluetoothSocket(); |
33 }; | 33 }; |
34 | 34 |
35 } // namespace device | 35 } // namespace device |
36 | 36 |
37 #endif // DEVICE_BLUETOOTH_TEST_MOCK_BLUETOOTH_SOCKET_H_ | 37 #endif // DEVICE_BLUETOOTH_TEST_MOCK_BLUETOOTH_SOCKET_H_ |
OLD | NEW |