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 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 } | |
OLD | NEW |