| 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 <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 uint16_t product_id, | 30 uint16_t product_id, |
| 31 const std::string& manufacturer_string, | 31 const std::string& manufacturer_string, |
| 32 const std::string& product_string, | 32 const std::string& product_string, |
| 33 const std::string& serial_number, | 33 const std::string& serial_number, |
| 34 const GURL& webusb_landing_page); | 34 const GURL& webusb_landing_page); |
| 35 MockUsbDevice(uint16_t vendor_id, | 35 MockUsbDevice(uint16_t vendor_id, |
| 36 uint16_t product_id, | 36 uint16_t product_id, |
| 37 const UsbConfigDescriptor& configuration); | 37 const UsbConfigDescriptor& configuration); |
| 38 MockUsbDevice(uint16_t vendor_id, | 38 MockUsbDevice(uint16_t vendor_id, |
| 39 uint16_t product_id, | 39 uint16_t product_id, |
| 40 uint8_t device_class, |
| 41 const std::vector<UsbConfigDescriptor>& configurations); |
| 42 MockUsbDevice(uint16_t vendor_id, |
| 43 uint16_t product_id, |
| 40 const std::string& manufacturer_string, | 44 const std::string& manufacturer_string, |
| 41 const std::string& product_string, | 45 const std::string& product_string, |
| 42 const std::string& serial_number, | 46 const std::string& serial_number, |
| 43 const std::vector<UsbConfigDescriptor>& configurations); | 47 const std::vector<UsbConfigDescriptor>& configurations); |
| 44 | 48 |
| 45 MOCK_METHOD1(Open, void(const OpenCallback&)); | 49 MOCK_METHOD1(Open, void(const OpenCallback&)); |
| 46 | 50 |
| 47 void AddMockConfig(const UsbConfigDescriptor& config); | 51 void AddMockConfig(const UsbConfigDescriptor& config); |
| 48 | 52 |
| 49 void set_webusb_allowed_origins( | 53 void set_webusb_allowed_origins( |
| 50 std::unique_ptr<WebUsbAllowedOrigins> webusb_allowed_origins) { | 54 std::unique_ptr<WebUsbAllowedOrigins> webusb_allowed_origins) { |
| 51 webusb_allowed_origins_ = std::move(webusb_allowed_origins); | 55 webusb_allowed_origins_ = std::move(webusb_allowed_origins); |
| 52 } | 56 } |
| 53 | 57 |
| 54 // Public wrappers around protected functions. | 58 // Public wrappers around protected functions. |
| 55 void ActiveConfigurationChanged(int configuration_value); | 59 void ActiveConfigurationChanged(int configuration_value); |
| 56 void NotifyDeviceRemoved(); | 60 void NotifyDeviceRemoved(); |
| 57 | 61 |
| 58 private: | 62 private: |
| 59 ~MockUsbDevice() override; | 63 ~MockUsbDevice() override; |
| 60 }; | 64 }; |
| 61 | 65 |
| 62 } // namespace device | 66 } // namespace device |
| 63 | 67 |
| 64 #endif // DEVICE_USB_MOCK_USB_DEVICE_H_ | 68 #endif // DEVICE_USB_MOCK_USB_DEVICE_H_ |
| OLD | NEW |