Bug 1517695 [wpt PR 14710] - Add USB control commands to CrostiniManager, a=testonly
authorFergus Dall <sidereal@google.com>
Thu, 31 Jan 2019 15:45:26 +0000
changeset 457890 e8d71369aaa1f385d074caa061037100bcb909bc
parent 457889 e38a87ea1142063446fd7d8bd3e192ecff9aa0fe
child 457891 c0fe813241a5041aec5fd25054a003016720745c
push id35518
push useropoprus@mozilla.com
push dateFri, 08 Feb 2019 09:55:14 +0000
treeherdermozilla-central@3a3e393396f4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1517695, 14710, 891381, 1350417, 620630
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1517695 [wpt PR 14710] - Add USB control commands to CrostiniManager, a=testonly Automatic update from web-platform-tests Add USB control commands to CrostiniManager This CL allows users of CrostiniManager to add, remove, and list USB devices attached to a vm. This will ultimately allow USB devices to be shared with Crostini using the UI. Bug: 891381 Change-Id: Id81ca37348df5b57c69a76d7f6123cdfac6ec685 Reviewed-on: https://chromium-review.googlesource.com/c/1350417 Commit-Queue: Fergus Dall <sidereal@google.com> Reviewed-by: Steven Bennetts <stevenjb@chromium.org> Reviewed-by: Nicholas Verne <nverne@chromium.org> Reviewed-by: Dominick Ng <dominickn@chromium.org> Reviewed-by: Reilly Grant <reillyg@chromium.org> Cr-Commit-Position: refs/heads/master@{#620630} -- wpt-commits: 3655845ca075dfd419ce15abedd073f7df58abf8 wpt-pr: 14710
testing/web-platform/tests/resources/chromium/device.mojom.js
testing/web-platform/tests/resources/chromium/mojo_bindings.js
--- a/testing/web-platform/tests/resources/chromium/device.mojom.js
+++ b/testing/web-platform/tests/resources/chromium/device.mojom.js
@@ -523,16 +523,18 @@
     this.guid = null;
     this.usbVersionMajor = 0;
     this.usbVersionMinor = 0;
     this.usbVersionSubminor = 0;
     this.classCode = 0;
     this.subclassCode = 0;
     this.protocolCode = 0;
     this.vendorId = 0;
+    this.busNumber = 0;
+    this.portNumber = 0;
     this.productId = 0;
     this.deviceVersionMajor = 0;
     this.deviceVersionMinor = 0;
     this.deviceVersionSubminor = 0;
     this.activeConfiguration = 0;
     this.manufacturerName = null;
     this.productName = null;
     this.serialNumber = null;
@@ -548,17 +550,17 @@
 
   UsbDeviceInfo.validate = function(messageValidator, offset) {
     var err;
     err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize);
     if (err !== validator.validationError.NONE)
         return err;
 
     var kVersionSizes = [
-      {version: 0, numBytes: 72}
+      {version: 0, numBytes: 80}
     ];
     err = messageValidator.validateStructVersion(offset, kVersionSizes);
     if (err !== validator.validationError.NONE)
         return err;
 
 
     // validate UsbDeviceInfo.guid
     err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 0, false)
@@ -572,64 +574,68 @@
 
 
 
 
 
 
 
 
+
+
     // validate UsbDeviceInfo.manufacturerName
-    err = messageValidator.validateStructPointer(offset + codec.kStructHeaderSize + 24, string16$.String16, true);
+    err = messageValidator.validateStructPointer(offset + codec.kStructHeaderSize + 32, string16$.String16, true);
     if (err !== validator.validationError.NONE)
         return err;
 
 
     // validate UsbDeviceInfo.productName
-    err = messageValidator.validateStructPointer(offset + codec.kStructHeaderSize + 32, string16$.String16, true);
+    err = messageValidator.validateStructPointer(offset + codec.kStructHeaderSize + 40, string16$.String16, true);
     if (err !== validator.validationError.NONE)
         return err;
 
 
     // validate UsbDeviceInfo.serialNumber
-    err = messageValidator.validateStructPointer(offset + codec.kStructHeaderSize + 40, string16$.String16, true);
+    err = messageValidator.validateStructPointer(offset + codec.kStructHeaderSize + 48, string16$.String16, true);
     if (err !== validator.validationError.NONE)
         return err;
 
 
     // validate UsbDeviceInfo.webusbLandingPage
-    err = messageValidator.validateStructPointer(offset + codec.kStructHeaderSize + 48, url$.Url, true);
+    err = messageValidator.validateStructPointer(offset + codec.kStructHeaderSize + 56, url$.Url, true);
     if (err !== validator.validationError.NONE)
         return err;
 
 
 
     // validate UsbDeviceInfo.configurations
-    err = messageValidator.validateArrayPointer(offset + codec.kStructHeaderSize + 56, 8, new codec.PointerTo(UsbConfigurationInfo), false, [0], 0);
+    err = messageValidator.validateArrayPointer(offset + codec.kStructHeaderSize + 64, 8, new codec.PointerTo(UsbConfigurationInfo), false, [0], 0);
     if (err !== validator.validationError.NONE)
         return err;
 
     return validator.validationError.NONE;
   };
 
-  UsbDeviceInfo.encodedSize = codec.kStructHeaderSize + 64;
+  UsbDeviceInfo.encodedSize = codec.kStructHeaderSize + 72;
 
   UsbDeviceInfo.decode = function(decoder) {
     var packed;
     var val = new UsbDeviceInfo();
     var numberOfBytes = decoder.readUint32();
     var version = decoder.readUint32();
     val.guid = decoder.decodeStruct(codec.String);
     val.usbVersionMajor = decoder.decodeStruct(codec.Uint8);
     val.usbVersionMinor = decoder.decodeStruct(codec.Uint8);
     val.usbVersionSubminor = decoder.decodeStruct(codec.Uint8);
     val.classCode = decoder.decodeStruct(codec.Uint8);
     val.subclassCode = decoder.decodeStruct(codec.Uint8);
     val.protocolCode = decoder.decodeStruct(codec.Uint8);
     val.vendorId = decoder.decodeStruct(codec.Uint16);
+    val.busNumber = decoder.decodeStruct(codec.Uint32);
+    val.portNumber = decoder.decodeStruct(codec.Uint32);
     val.productId = decoder.decodeStruct(codec.Uint16);
     val.deviceVersionMajor = decoder.decodeStruct(codec.Uint8);
     val.deviceVersionMinor = decoder.decodeStruct(codec.Uint8);
     val.deviceVersionSubminor = decoder.decodeStruct(codec.Uint8);
     val.activeConfiguration = decoder.decodeStruct(codec.Uint8);
     decoder.skip(1);
     decoder.skip(1);
     val.manufacturerName = decoder.decodeStructPointer(string16$.String16);
@@ -647,16 +653,18 @@
     encoder.encodeStruct(codec.String, val.guid);
     encoder.encodeStruct(codec.Uint8, val.usbVersionMajor);
     encoder.encodeStruct(codec.Uint8, val.usbVersionMinor);
     encoder.encodeStruct(codec.Uint8, val.usbVersionSubminor);
     encoder.encodeStruct(codec.Uint8, val.classCode);
     encoder.encodeStruct(codec.Uint8, val.subclassCode);
     encoder.encodeStruct(codec.Uint8, val.protocolCode);
     encoder.encodeStruct(codec.Uint16, val.vendorId);
+    encoder.encodeStruct(codec.Uint32, val.busNumber);
+    encoder.encodeStruct(codec.Uint32, val.portNumber);
     encoder.encodeStruct(codec.Uint16, val.productId);
     encoder.encodeStruct(codec.Uint8, val.deviceVersionMajor);
     encoder.encodeStruct(codec.Uint8, val.deviceVersionMinor);
     encoder.encodeStruct(codec.Uint8, val.deviceVersionSubminor);
     encoder.encodeStruct(codec.Uint8, val.activeConfiguration);
     encoder.skip(1);
     encoder.skip(1);
     encoder.encodeStructPointer(string16$.String16, val.manufacturerName);
--- a/testing/web-platform/tests/resources/chromium/mojo_bindings.js
+++ b/testing/web-platform/tests/resources/chromium/mojo_bindings.js
@@ -5138,9 +5138,9 @@ if (typeof mojo.config.autoLoadMojomDeps
     };
 
   RunOrClosePipeInput.encodedSize = 16;
   exports.kRunOrClosePipeMessageId = kRunOrClosePipeMessageId;
   exports.RunOrClosePipeMessageParams = RunOrClosePipeMessageParams;
   exports.DisconnectReason = DisconnectReason;
   exports.PeerAssociatedEndpointClosedEvent = PeerAssociatedEndpointClosedEvent;
   exports.RunOrClosePipeInput = RunOrClosePipeInput;
-})();
\ No newline at end of file
+})();