OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_USB_MOCK_USB_DEVICE_H_ | 5 #ifndef DEVICE_USB_MOCK_USB_DEVICE_H_ |
6 #define DEVICE_USB_MOCK_USB_DEVICE_H_ | 6 #define DEVICE_USB_MOCK_USB_DEVICE_H_ |
7 | 7 |
| 8 #include "device/usb/usb_device.h" |
| 9 |
8 #include <stdint.h> | 10 #include <stdint.h> |
9 | 11 |
10 #include <string> | 12 #include <string> |
11 #include <vector> | |
12 | 13 |
13 #include "device/usb/usb_device.h" | |
14 #include "device/usb/usb_device_handle.h" | 14 #include "device/usb/usb_device_handle.h" |
15 #include "testing/gmock/include/gmock/gmock.h" | 15 #include "testing/gmock/include/gmock/gmock.h" |
16 | 16 |
17 namespace device { | 17 namespace device { |
18 | 18 |
19 class MockUsbDevice : public UsbDevice { | 19 class MockUsbDevice : public UsbDevice { |
20 public: | 20 public: |
21 MockUsbDevice(uint16_t vendor_id, uint16_t product_id); | 21 MockUsbDevice(uint16_t vendor_id, uint16_t product_id); |
22 MockUsbDevice(uint16_t vendor_id, | 22 MockUsbDevice(uint16_t vendor_id, |
23 uint16_t product_id, | 23 uint16_t product_id, |
(...skipping 10 matching lines...) Expand all Loading... |
34 uint16_t product_id, | 34 uint16_t product_id, |
35 const UsbConfigDescriptor& configuration); | 35 const UsbConfigDescriptor& configuration); |
36 MockUsbDevice(uint16_t vendor_id, | 36 MockUsbDevice(uint16_t vendor_id, |
37 uint16_t product_id, | 37 uint16_t product_id, |
38 const std::string& manufacturer_string, | 38 const std::string& manufacturer_string, |
39 const std::string& product_string, | 39 const std::string& product_string, |
40 const std::string& serial_number, | 40 const std::string& serial_number, |
41 const std::vector<UsbConfigDescriptor>& configurations); | 41 const std::vector<UsbConfigDescriptor>& configurations); |
42 | 42 |
43 MOCK_METHOD1(Open, void(const OpenCallback&)); | 43 MOCK_METHOD1(Open, void(const OpenCallback&)); |
| 44 MOCK_METHOD1(Close, bool(scoped_refptr<UsbDeviceHandle>)); |
44 MOCK_METHOD0(GetActiveConfiguration, const device::UsbConfigDescriptor*()); | 45 MOCK_METHOD0(GetActiveConfiguration, const device::UsbConfigDescriptor*()); |
45 | 46 |
46 private: | 47 private: |
47 ~MockUsbDevice() override; | 48 ~MockUsbDevice() override; |
48 }; | 49 }; |
49 | 50 |
50 } // namespace device | 51 } // namespace device |
51 | 52 |
52 #endif // DEVICE_USB_MOCK_USB_DEVICE_H_ | 53 #endif // DEVICE_USB_MOCK_USB_DEVICE_H_ |
OLD | NEW |