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