OLD | NEW |
(Empty) | |
| 1 'use strict'; |
| 2 |
| 3 function fakeUsbDevices() { |
| 4 return define('Fake USB Devices', [ |
| 5 'device/usb/public/interfaces/device.mojom', |
| 6 ], device => Promise.resolve([ |
| 7 { |
| 8 guid: 'CD9FA048-FC9B-7A71-DBFC-FD44B78D6397', |
| 9 usb_version_major: 2, |
| 10 usb_version_minor: 0, |
| 11 usb_version_subminor: 0, |
| 12 class_code: 7, |
| 13 subclass_code: 1, |
| 14 protocol_code: 2, |
| 15 vendor_id: 0x18d1, |
| 16 product_id: 0xf00d, |
| 17 device_version_major: 1, |
| 18 device_version_minor: 2, |
| 19 device_version_subminor: 3, |
| 20 manufacturer_name: 'Google, Inc.', |
| 21 product_name: 'The amazing imaginary printer', |
| 22 serial_number: '4', |
| 23 configurations: [ |
| 24 { |
| 25 configuration_value: 1, |
| 26 configuration_name: 'Printer Mode', |
| 27 interfaces: [ |
| 28 { |
| 29 interface_number: 0, |
| 30 alternates: [ |
| 31 { |
| 32 alternate_setting: 0, |
| 33 class_code: 0xff, |
| 34 subclass_code: 0x01, |
| 35 protocol_code: 0x01, |
| 36 interface_name: 'Control', |
| 37 endpoints: [ |
| 38 { |
| 39 endpoint_number: 1, |
| 40 direction: device.TransferDirection.INBOUND, |
| 41 type: device.EndpointType.INTERRUPT, |
| 42 packet_size: 8 |
| 43 } |
| 44 ] |
| 45 } |
| 46 ] |
| 47 }, |
| 48 { |
| 49 interface_number: 1, |
| 50 alternates: [ |
| 51 { |
| 52 alternate_setting: 0, |
| 53 class_code: 0xff, |
| 54 subclass_code: 0x02, |
| 55 protocol_code: 0x01, |
| 56 interface_name: 'Data', |
| 57 endpoints: [ |
| 58 { |
| 59 endpoint_number: 2, |
| 60 direction: device.TransferDirection.INBOUND, |
| 61 type: device.EndpointType.BULK, |
| 62 packet_size: 1024 |
| 63 }, |
| 64 { |
| 65 endpoint_number: 2, |
| 66 direction: device.TransferDirection.OUTBOUND, |
| 67 type: device.EndpointType.BULK, |
| 68 packet_size: 1024 |
| 69 } |
| 70 ] |
| 71 } |
| 72 ] |
| 73 } |
| 74 ] |
| 75 }, |
| 76 { |
| 77 configuration_value: 2, |
| 78 configuration_name: 'Fighting Robot Mode', |
| 79 interfaces: [ |
| 80 { |
| 81 interface_number: 0, |
| 82 alternates: [ |
| 83 { |
| 84 alternate_setting: 0, |
| 85 class_code: 0xff, |
| 86 subclass_code: 0x42, |
| 87 protocol_code: 0x01, |
| 88 interface_name: 'Disabled', |
| 89 endpoints: [] |
| 90 }, |
| 91 { |
| 92 alternate_setting: 1, |
| 93 class_code: 0xff, |
| 94 subclass_code: 0x42, |
| 95 protocol_code: 0x01, |
| 96 interface_name: 'Activate!', |
| 97 endpoints: [ |
| 98 { |
| 99 endpoint_number: 1, |
| 100 direction: device.TransferDirection.INBOUND, |
| 101 type: device.EndpointType.ISOCHRONOUS, |
| 102 packet_size: 1024 |
| 103 }, |
| 104 { |
| 105 endpoint_number: 1, |
| 106 direction: device.TransferDirection.OUTBOUND, |
| 107 type: device.EndpointType.ISOCHRONOUS, |
| 108 packet_size: 1024 |
| 109 } |
| 110 ] |
| 111 } |
| 112 ] |
| 113 }, |
| 114 ] |
| 115 } |
| 116 ], |
| 117 webusb_allowed_origins: { origins: [], configurations: [] }, |
| 118 } |
| 119 ])); |
| 120 } |
OLD | NEW |