| OLD | NEW |
| 1 'use strict'; | 1 'use strict'; |
| 2 | 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 active_configuration: 0, | |
| 24 configurations: [ | |
| 25 { | |
| 26 configuration_value: 1, | |
| 27 configuration_name: 'Printer Mode', | |
| 28 interfaces: [ | |
| 29 { | |
| 30 interface_number: 0, | |
| 31 alternates: [ | |
| 32 { | |
| 33 alternate_setting: 0, | |
| 34 class_code: 0xff, | |
| 35 subclass_code: 0x01, | |
| 36 protocol_code: 0x01, | |
| 37 interface_name: 'Control', | |
| 38 endpoints: [ | |
| 39 { | |
| 40 endpoint_number: 1, | |
| 41 direction: device.TransferDirection.INBOUND, | |
| 42 type: device.EndpointType.INTERRUPT, | |
| 43 packet_size: 8 | |
| 44 } | |
| 45 ] | |
| 46 } | |
| 47 ] | |
| 48 }, | |
| 49 { | |
| 50 interface_number: 1, | |
| 51 alternates: [ | |
| 52 { | |
| 53 alternate_setting: 0, | |
| 54 class_code: 0xff, | |
| 55 subclass_code: 0x02, | |
| 56 protocol_code: 0x01, | |
| 57 interface_name: 'Data', | |
| 58 endpoints: [ | |
| 59 { | |
| 60 endpoint_number: 2, | |
| 61 direction: device.TransferDirection.INBOUND, | |
| 62 type: device.EndpointType.BULK, | |
| 63 packet_size: 1024 | |
| 64 }, | |
| 65 { | |
| 66 endpoint_number: 2, | |
| 67 direction: device.TransferDirection.OUTBOUND, | |
| 68 type: device.EndpointType.BULK, | |
| 69 packet_size: 1024 | |
| 70 } | |
| 71 ] | |
| 72 } | |
| 73 ] | |
| 74 } | |
| 75 ] | |
| 76 }, | |
| 77 { | |
| 78 configuration_value: 2, | |
| 79 configuration_name: 'Fighting Robot Mode', | |
| 80 interfaces: [ | |
| 81 { | |
| 82 interface_number: 0, | |
| 83 alternates: [ | |
| 84 { | |
| 85 alternate_setting: 0, | |
| 86 class_code: 0xff, | |
| 87 subclass_code: 0x42, | |
| 88 protocol_code: 0x01, | |
| 89 interface_name: 'Disabled', | |
| 90 endpoints: [] | |
| 91 }, | |
| 92 { | |
| 93 alternate_setting: 1, | |
| 94 class_code: 0xff, | |
| 95 subclass_code: 0x42, | |
| 96 protocol_code: 0x01, | |
| 97 interface_name: 'Activate!', | |
| 98 endpoints: [ | |
| 99 { | |
| 100 endpoint_number: 1, | |
| 101 direction: device.TransferDirection.INBOUND, | |
| 102 type: device.EndpointType.ISOCHRONOUS, | |
| 103 packet_size: 1024 | |
| 104 }, | |
| 105 { | |
| 106 endpoint_number: 1, | |
| 107 direction: device.TransferDirection.OUTBOUND, | |
| 108 type: device.EndpointType.ISOCHRONOUS, | |
| 109 packet_size: 1024 | |
| 110 } | |
| 111 ] | |
| 112 } | |
| 113 ] | |
| 114 }, | |
| 115 ] | |
| 116 } | |
| 117 ], | |
| 118 webusb_allowed_origins: { origins: [], configurations: [] }, | |
| 119 } | |
| 120 ])); | |
| 121 } | |
| 122 | |
| 123 let fakeDeviceInit = { | 3 let fakeDeviceInit = { |
| 124 usbVersionMajor: 2, | 4 usbVersionMajor: 2, |
| 125 usbVersionMinor: 0, | 5 usbVersionMinor: 0, |
| 126 usbVersionSubminor: 0, | 6 usbVersionSubminor: 0, |
| 127 deviceClass: 7, | 7 deviceClass: 7, |
| 128 deviceSubclass: 1, | 8 deviceSubclass: 1, |
| 129 deviceProtocol: 2, | 9 deviceProtocol: 2, |
| 130 vendorId: 0x18d1, | 10 vendorId: 0x18d1, |
| 131 productId: 0xf00d, | 11 productId: 0xf00d, |
| 132 deviceVersionMajor: 1, | 12 deviceVersionMajor: 1, |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 }, { | 81 }, { |
| 202 endpointNumber: 1, | 82 endpointNumber: 1, |
| 203 direction: 'out', | 83 direction: 'out', |
| 204 type: 'isochronous', | 84 type: 'isochronous', |
| 205 packetSize: 1024 | 85 packetSize: 1024 |
| 206 }] | 86 }] |
| 207 }] | 87 }] |
| 208 }] | 88 }] |
| 209 }] | 89 }] |
| 210 }; | 90 }; |
| OLD | NEW |