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" | 8 #include "device/usb/usb_device.h" |
9 | 9 |
10 #include <string> | 10 #include <string> |
11 | 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 vendor_id, uint16 product_id); | 19 MockUsbDevice(uint16 vendor_id, uint16 product_id); |
20 MockUsbDevice(uint16 vendor_id, | 20 MockUsbDevice(uint16 vendor_id, |
21 uint16 product_id, | 21 uint16 product_id, |
22 const std::string& manufacturer_string, | 22 const std::string& manufacturer_string, |
23 const std::string& product_string, | 23 const std::string& product_string, |
24 const std::string& serial_number); | 24 const std::string& serial_number); |
| 25 MockUsbDevice(uint16 vendor_id, |
| 26 uint16 product_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); |
25 | 31 |
26 MOCK_METHOD1(Open, void(const OpenCallback&)); | 32 MOCK_METHOD1(Open, void(const OpenCallback&)); |
27 MOCK_METHOD1(Close, bool(scoped_refptr<UsbDeviceHandle>)); | 33 MOCK_METHOD1(Close, bool(scoped_refptr<UsbDeviceHandle>)); |
28 MOCK_METHOD0(GetActiveConfiguration, const device::UsbConfigDescriptor*()); | 34 MOCK_METHOD0(GetActiveConfiguration, const device::UsbConfigDescriptor*()); |
29 | 35 |
30 private: | 36 private: |
31 ~MockUsbDevice() override; | 37 ~MockUsbDevice() override; |
32 }; | 38 }; |
33 | 39 |
34 } // namespace device | 40 } // namespace device |
35 | 41 |
36 #endif // DEVICE_USB_MOCK_USB_DEVICE_H_ | 42 #endif // DEVICE_USB_MOCK_USB_DEVICE_H_ |
OLD | NEW |