Chromium Code Reviews| 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 "testing/gmock/include/gmock/gmock.h" | 12 #include "testing/gmock/include/gmock/gmock.h" |
| 12 | 13 |
| 13 namespace net { | |
| 14 | |
| 15 class DrainableIOBuffer; | |
| 16 class GrowableIOBuffer; | |
| 17 | |
| 18 } // namespace net | |
| 19 | |
| 20 namespace device { | 14 namespace device { |
| 21 | 15 |
| 22 class MockBluetoothSocket : public BluetoothSocket { | 16 class MockBluetoothSocket : public BluetoothSocket { |
| 23 public: | 17 public: |
| 24 MockBluetoothSocket(); | 18 MockBluetoothSocket(); |
| 25 MOCK_METHOD1(Receive, bool(net::GrowableIOBuffer*)); | 19 MOCK_METHOD0(Destruct, void()); |
| 26 MOCK_METHOD1(Send, bool(net::DrainableIOBuffer*)); | 20 MOCK_METHOD2(Connect, |
| 27 MOCK_CONST_METHOD0(GetLastErrorMessage, std::string()); | 21 void(const base::Closure& success_callback, |
| 22 const ErrorCompletionCallback& error_callback)); | |
|
keybuk
2014/03/27 20:20:07
There is no Connect, there is only ...
| |
| 23 MOCK_METHOD1(Disconnect, void(const base::Closure& callback)); | |
| 24 MOCK_METHOD3(Receive, | |
| 25 void(int count, | |
| 26 const ReceiveCompletionCallback& success_callback, | |
| 27 const ReceiveErrorCompletionCallback& error_callback)); | |
| 28 MOCK_METHOD4(Send, | |
| 29 void(scoped_refptr<net::IOBuffer> buffer, | |
| 30 int buffer_size, | |
| 31 const SendCompletionCallback& success_callback, | |
| 32 const ErrorCompletionCallback& error_callback)); | |
| 28 | 33 |
| 29 protected: | 34 protected: |
| 30 virtual ~MockBluetoothSocket(); | 35 virtual ~MockBluetoothSocket(); |
| 31 }; | 36 }; |
| 32 | 37 |
| 33 } // namespace device | 38 } // namespace device |
| 34 | 39 |
| 35 #endif // DEVICE_BLUETOOTH_TEST_MOCK_BLUETOOTH_SOCKET_H_ | 40 #endif // DEVICE_BLUETOOTH_TEST_MOCK_BLUETOOTH_SOCKET_H_ |
| OLD | NEW |