Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(673)

Side by Side Diff: third_party/WebKit/LayoutTests/usb/resources/fake-devices.js

Issue 2775323003: Refactor WebUSB LayoutTests to separate out the Mojo service mocks (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 'use strict'; 1 'use strict';
2 2
3 function fakeUsbDevices() { 3 function fakeUsbDevices() {
4 return define('Fake USB Devices', [ 4 return define('Fake USB Devices', [
5 'device/usb/public/interfaces/device.mojom', 5 'device/usb/public/interfaces/device.mojom',
6 ], device => Promise.resolve([ 6 ], device => Promise.resolve([
7 { 7 {
8 guid: 'CD9FA048-FC9B-7A71-DBFC-FD44B78D6397', 8 guid: 'CD9FA048-FC9B-7A71-DBFC-FD44B78D6397',
9 usb_version_major: 2, 9 usb_version_major: 2,
10 usb_version_minor: 0, 10 usb_version_minor: 0,
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 } 112 }
113 ] 113 ]
114 }, 114 },
115 ] 115 ]
116 } 116 }
117 ], 117 ],
118 webusb_allowed_origins: { origins: [], configurations: [] }, 118 webusb_allowed_origins: { origins: [], configurations: [] },
119 } 119 }
120 ])); 120 ]));
121 } 121 }
122
123 let fakeDeviceInit = {
124 usbVersionMajor: 2,
125 usbVersionMinor: 0,
126 usbVersionSubminor: 0,
127 deviceClass: 7,
128 deviceSubclass: 1,
129 deviceProtocol: 2,
130 vendorId: 0x18d1,
131 productId: 0xf00d,
132 deviceVersionMajor: 1,
133 deviceVersionMinor: 2,
134 deviceVersionSubminor: 3,
135 manufacturerName: 'Google, Inc.',
136 productName: 'The amazing imaginary printer',
137 serialNumber: '4',
138 activeConfigurationValue: 0,
139 configurations: [{
140 configurationValue: 1,
141 configurationName: 'Printer Mode',
142 interfaces: [{
143 interfaceNumber: 0,
144 alternates: [{
145 alternateSetting: 0,
146 interfaceClass: 0xff,
147 interfaceSubclass: 0x01,
148 interfaceProtocol: 0x01,
149 interfaceName: 'Control',
150 endpoints: [{
151 endpointNumber: 1,
152 direction: 'in',
153 type: 'interrupt',
154 packetSize: 8
155 }]
156 }]
157 }, {
158 interfaceNumber: 1,
159 alternates: [{
160 alternateSetting: 0,
161 interfaceClass: 0xff,
162 interfaceSubclass: 0x02,
163 interfaceProtocol: 0x01,
164 interfaceName: 'Data',
165 endpoints: [{
166 endpointNumber: 2,
167 direction: 'in',
168 type: 'bulk',
169 packetSize: 1024
170 }, {
171 endpointNumber: 2,
172 direction: 'out',
173 type: 'bulk',
174 packetSize: 1024
175 }]
176 }]
177 }]
178 }, {
179 configurationValue: 2,
180 configurationName: 'Fighting Robot Mode',
181 interfaces: [{
182 interfaceNumber: 0,
183 alternates: [{
184 alternateSetting: 0,
185 interfaceClass: 0xff,
186 interfaceSubclass: 0x42,
187 interfaceProtocol: 0x01,
188 interfaceName: 'Disabled',
189 endpoints: []
190 }, {
191 alternateSetting: 1,
192 interfaceClass: 0xff,
193 interfaceSubclass: 0x42,
194 interfaceProtocol: 0x01,
195 interfaceName: 'Activate!',
196 endpoints: [{
197 endpointNumber: 1,
198 direction: 'in',
199 type: 'isochronous',
200 packetSize: 1024
201 }, {
202 endpointNumber: 1,
203 direction: 'out',
204 type: 'isochronous',
205 packetSize: 1024
206 }]
207 }]
208 }]
209 }]
210 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698