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
3 // found in the LICENSE file.
5 #ifndef DEVICE_USB_MOCK_USB_DEVICE_H_
6 #define DEVICE_USB_MOCK_USB_DEVICE_H_
8 #include "device/usb/usb_device.h"
12 #include "device/usb/usb_device_handle.h"
13 #include "testing/gmock/include/gmock/gmock.h"
17 class MockUsbDevice
: public UsbDevice
{
19 MockUsbDevice(uint16 vendor_id
, uint16 product_id
);
20 MockUsbDevice(uint16 vendor_id
,
22 const std::string
& manufacturer_string
,
23 const std::string
& product_string
,
24 const std::string
& serial_number
);
25 MockUsbDevice(uint16 vendor_id
,
27 const std::string
& manufacturer_string
,
28 const std::string
& product_string
,
29 const std::string
& serial_number
,
30 const GURL
& webusb_landing_page
);
31 MockUsbDevice(uint16 vendor_id
,
33 const UsbConfigDescriptor
& configuration
);
34 MockUsbDevice(uint16 vendor_id
,
36 const std::string
& manufacturer_string
,
37 const std::string
& product_string
,
38 const std::string
& serial_number
,
39 const std::vector
<UsbConfigDescriptor
>& configurations
);
41 MOCK_METHOD1(Open
, void(const OpenCallback
&));
42 MOCK_METHOD1(Close
, bool(scoped_refptr
<UsbDeviceHandle
>));
43 MOCK_METHOD0(GetActiveConfiguration
, const device::UsbConfigDescriptor
*());
46 ~MockUsbDevice() override
;
51 #endif // DEVICE_USB_MOCK_USB_DEVICE_H_