Merge pull request #9330 from youennf/wpt-export-for-webkit-181087
WebKit export of https://bugs.webkit.org/show_bug.cgi?id=181087
diff --git a/css/css-typed-om/stylevalue-serialization/cssMathValue.tentative.html b/css/css-typed-om/stylevalue-serialization/cssMathValue.tentative.html
index 814812e..fd9fce8 100644
--- a/css/css-typed-om/stylevalue-serialization/cssMathValue.tentative.html
+++ b/css/css-typed-om/stylevalue-serialization/cssMathValue.tentative.html
@@ -1,8 +1,6 @@
<!doctype html>
<meta charset="utf-8">
<title>IDL-constructed CSSMathValue serialization tests</title>
-<!-- Tentative because this depends on css-values-4 spec, which is still WIP:
- https://drafts.csswg.org/css-values-4/#calc-notation -->
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#calc-serialization">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
@@ -12,69 +10,104 @@
const gTestCases = [
{
- description: 'CSSMathSum with 1 argument',
- value: new CSSMathSum(CSS.px(1)),
- cssText: 'calc(1px)',
- },
- {
- description: 'CSSMathSum with 2 arguments',
- value: new CSSMathSum(CSS.px(1), CSS.px(2)),
- cssText: 'calc(1px + 2px)',
- },
- {
- description: 'CSSMathSum with more than 2 arguments',
- value: new CSSMathSum(CSS.px(1), CSS.px(2), CSS.px(3)),
- cssText: 'calc((1px + 2px) + 3px)',
- },
- {
- description: 'CSSMathProduct with 1 argument',
- value: new CSSMathProduct(CSS.px(1)),
- cssText: 'calc(1px)',
- },
- {
- description: 'CSSMathProduct with 2 arguments',
- value: new CSSMathProduct(CSS.px(1), 2),
- cssText: 'calc(1px * 2)',
- },
- {
- description: 'CSSMathProduct with more than 2 arguments',
- value: new CSSMathProduct(CSS.px(1), 2, 3),
- cssText: 'calc((1px * 2) * 3)',
- },
- {
- description: 'CSSMathProduct of two different base types',
- value: new CSSMathProduct(CSS.px(1), CSS.s(1)),
- cssText: 'calc(1px * 1s)',
- },
- {
description: 'CSSMathMax with one argument',
- value: new CSSMathMax(CSS.px(2)),
- cssText: 'max(1px)',
+ value: new CSSMathMax(1),
+ cssText: 'max(1)',
},
{
description: 'CSSMathMax with more than one argument',
- value: new CSSMathMax(CSS.px(2), CSS.px(1)),
- cssText: 'max(1px, 1s)',
+ value: new CSSMathMax(1, 2, 3),
+ cssText: 'max(1, 2, 3)',
+ },
+ {
+ description: 'CSSMathMax containing nested CSSMathValues',
+ value: new CSSMathMax(new CSSMathSum(1, 2), 3),
+ cssText: 'max(1 + 2, 3)',
},
{
description: 'CSSMathMin with one argument',
- value: new CSSMathMin(CSS.px(1)),
- cssText: 'min(1px)',
+ value: new CSSMathMin(1),
+ cssText: 'min(1)',
},
{
description: 'CSSMathMin with more than one argument',
- value: new CSSMathMin(CSS.px(1), CSS.px(2)),
- cssText: 'min(1px, 2px)',
+ value: new CSSMathMin(1, 2, 3),
+ cssText: 'min(1, 2, 3)',
+ },
+ {
+ description: 'CSSMathMin containing nested CSSMathValues',
+ value: new CSSMathMin(new CSSMathSum(1, 2), 3),
+ cssText: 'min(1 + 2, 3)',
+ },
+ {
+ description: 'CSSMathSum with one argument',
+ value: new CSSMathSum(1),
+ cssText: 'calc(1)',
+ },
+ {
+ description: 'CSSMathSum with more than one argument',
+ value: new CSSMathSum(1, 2, 3),
+ cssText: 'calc(1 + 2 + 3)',
+ },
+ {
+ description: 'CSSMathSum with a CSSMathNegate as first value',
+ value: new CSSMathSum(new CSSMathNegate(1), 2, 3),
+ cssText: 'calc((-1) + 2 + 3)',
+ },
+ {
+ description: 'CSSMathSum containing a CSSMathNegate after first value',
+ value: new CSSMathSum(1, new CSSMathNegate(2), 3),
+ cssText: 'calc(1 - 2 + 3)',
+ },
+ {
+ description: 'CSSMathSum nested inside a CSSMathValue',
+ value: new CSSMathSum(new CSSMathSum(1, 2), 3),
+ cssText: 'calc((1 + 2) + 3)',
},
{
description: 'CSSMathNegate',
- value: new CSSMathNegate(CSS.px(1)),
- cssText: 'calc(- 1px)',
+ value: new CSSMathNegate(1),
+ cssText: 'calc(-1)',
+ },
+ {
+ description: 'CSSMathNegate nested inside a CSSMathValue',
+ value: new CSSMathProduct(new CSSMathNegate(1)),
+ cssText: 'calc((-1))',
+ },
+ {
+ description: 'CSSMathProduct with one argument',
+ value: new CSSMathProduct(1),
+ cssText: 'calc(1)',
+ },
+ {
+ description: 'CSSMathProduct with more than one argument',
+ value: new CSSMathProduct(1, 2, 3),
+ cssText: 'calc(1 * 2 * 3)',
+ },
+ {
+ description: 'CSSMathProduct with a CSSMathInvert as first value',
+ value: new CSSMathProduct(new CSSMathInvert(1), 2, 3),
+ cssText: 'calc((1 / 1) * 2 * 3)',
+ },
+ {
+ description: 'CSSMathProduct containing a CSSMathInvert after first value',
+ value: new CSSMathProduct(1, new CSSMathInvert(2), 3),
+ cssText: 'calc(1 / 2 * 3)',
+ },
+ {
+ description: 'CSSMathProduct nested inside a CSSMathValue',
+ value: new CSSMathProduct(new CSSMathProduct(1, 2), 3),
+ cssText: 'calc((1 * 2) * 3)',
},
{
description: 'CSSMathInvert',
- value: new CSSMathInvert(CSS.px(1)),
- cssText: 'calc(1 / 1px)',
+ value: new CSSMathInvert(1),
+ cssText: 'calc(1 / 1)',
+ },
+ {
+ description: 'CSSMathInvert nested inside a CSSMathValue',
+ value: new CSSMathSum(new CSSMathInvert(1)),
+ cssText: 'calc((1 / 1))',
},
];
diff --git a/resources/chromium/chooser_service.mojom.js b/resources/chromium/chooser_service.mojom.js
index 30bba4b..aee5d87 100644
--- a/resources/chromium/chooser_service.mojom.js
+++ b/resources/chromium/chooser_service.mojom.js
@@ -2,19 +2,15 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-
'use strict';
(function() {
- var mojomId = 'device/usb/public/interfaces/chooser_service.mojom';
+ var mojomId = 'device/usb/public/mojom/chooser_service.mojom';
if (mojo.internal.isMojomLoaded(mojomId)) {
console.warn('The following mojom is loaded multiple times: ' + mojomId);
return;
}
mojo.internal.markMojomLoaded(mojomId);
-
- // TODO(yzshen): Define these aliases to minimize the differences between the
- // old/new modes. Remove them when the old mode goes away.
var bindings = mojo;
var associatedBindings = mojo;
var codec = mojo.internal;
@@ -25,13 +21,13 @@
mojo.internal.exposeNamespace('device.mojom');
if (mojo.config.autoLoadMojomDeps) {
mojo.internal.loadMojomIfNecessary(
- 'device/usb/public/interfaces/device.mojom', 'device.mojom.js');
+ 'device/usb/public/mojom/device.mojom', 'device.mojom.js');
}
var device_manager$ =
mojo.internal.exposeNamespace('device.mojom');
if (mojo.config.autoLoadMojomDeps) {
mojo.internal.loadMojomIfNecessary(
- 'device/usb/public/interfaces/device_manager.mojom', 'device_manager.mojom.js');
+ 'device/usb/public/mojom/device_manager.mojom', 'device_manager.mojom.js');
}
@@ -66,7 +62,6 @@
return err;
-
// validate UsbChooserService_GetPermission_Params.deviceFilters
err = messageValidator.validateArrayPointer(offset + codec.kStructHeaderSize + 0, 8, new codec.PointerTo(device_manager$.UsbDeviceFilter), false, [0], 0);
if (err !== validator.validationError.NONE)
@@ -122,7 +117,6 @@
return err;
-
// validate UsbChooserService_GetPermission_ResponseParams.result
err = messageValidator.validateStructPointer(offset + codec.kStructHeaderSize + 0, device$.UsbDeviceInfo, true);
if (err !== validator.validationError.NONE)
diff --git a/resources/chromium/device.mojom.js b/resources/chromium/device.mojom.js
index ce5660c..6f37fab 100644
--- a/resources/chromium/device.mojom.js
+++ b/resources/chromium/device.mojom.js
@@ -2,19 +2,15 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-
'use strict';
(function() {
- var mojomId = 'device/usb/public/interfaces/device.mojom';
+ var mojomId = 'device/usb/public/mojom/device.mojom';
if (mojo.internal.isMojomLoaded(mojomId)) {
console.warn('The following mojom is loaded multiple times: ' + mojomId);
return;
}
mojo.internal.markMojomLoaded(mojomId);
-
- // TODO(yzshen): Define these aliases to minimize the differences between the
- // old/new modes. Remove them when the old mode goes away.
var bindings = mojo;
var associatedBindings = mojo;
var codec = mojo.internal;
@@ -212,14 +208,12 @@
-
// validate UsbEndpointInfo.direction
err = messageValidator.validateEnum(offset + codec.kStructHeaderSize + 4, UsbTransferDirection);
if (err !== validator.validationError.NONE)
return err;
-
// validate UsbEndpointInfo.type
err = messageValidator.validateEnum(offset + codec.kStructHeaderSize + 8, UsbTransferType);
if (err !== validator.validationError.NONE)
@@ -297,14 +291,12 @@
-
// validate UsbAlternateInterfaceInfo.interfaceName
err = messageValidator.validateStructPointer(offset + codec.kStructHeaderSize + 8, string16$.String16, true);
if (err !== validator.validationError.NONE)
return err;
-
// validate UsbAlternateInterfaceInfo.endpoints
err = messageValidator.validateArrayPointer(offset + codec.kStructHeaderSize + 16, 8, new codec.PointerTo(UsbEndpointInfo), false, [0], 0);
if (err !== validator.validationError.NONE)
@@ -380,7 +372,6 @@
-
// validate UsbInterfaceInfo.alternates
err = messageValidator.validateArrayPointer(offset + codec.kStructHeaderSize + 8, 8, new codec.PointerTo(UsbAlternateInterfaceInfo), false, [0], 0);
if (err !== validator.validationError.NONE)
@@ -455,14 +446,12 @@
-
// validate UsbConfigurationInfo.configurationName
err = messageValidator.validateStructPointer(offset + codec.kStructHeaderSize + 8, string16$.String16, true);
if (err !== validator.validationError.NONE)
return err;
-
// validate UsbConfigurationInfo.interfaces
err = messageValidator.validateArrayPointer(offset + codec.kStructHeaderSize + 16, 8, new codec.PointerTo(UsbInterfaceInfo), false, [0], 0);
if (err !== validator.validationError.NONE)
@@ -552,7 +541,6 @@
return err;
-
// validate UsbDeviceInfo.guid
err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 0, false)
if (err !== validator.validationError.NONE)
@@ -570,21 +558,18 @@
-
// validate UsbDeviceInfo.manufacturerName
err = messageValidator.validateStructPointer(offset + codec.kStructHeaderSize + 24, string16$.String16, true);
if (err !== validator.validationError.NONE)
return err;
-
// validate UsbDeviceInfo.productName
err = messageValidator.validateStructPointer(offset + codec.kStructHeaderSize + 32, string16$.String16, true);
if (err !== validator.validationError.NONE)
return err;
-
// validate UsbDeviceInfo.serialNumber
err = messageValidator.validateStructPointer(offset + codec.kStructHeaderSize + 40, string16$.String16, true);
if (err !== validator.validationError.NONE)
@@ -592,7 +577,6 @@
-
// validate UsbDeviceInfo.configurations
err = messageValidator.validateArrayPointer(offset + codec.kStructHeaderSize + 48, 8, new codec.PointerTo(UsbConfigurationInfo), false, [0], 0);
if (err !== validator.validationError.NONE)
@@ -688,14 +672,12 @@
return err;
-
// validate UsbControlTransferParams.type
err = messageValidator.validateEnum(offset + codec.kStructHeaderSize + 0, UsbControlTransferType);
if (err !== validator.validationError.NONE)
return err;
-
// validate UsbControlTransferParams.recipient
err = messageValidator.validateEnum(offset + codec.kStructHeaderSize + 4, UsbControlTransferRecipient);
if (err !== validator.validationError.NONE)
@@ -772,7 +754,6 @@
-
// validate UsbIsochronousPacket.status
err = messageValidator.validateEnum(offset + codec.kStructHeaderSize + 8, UsbTransferStatus);
if (err !== validator.validationError.NONE)
@@ -886,7 +867,6 @@
return err;
-
// validate UsbDevice_Open_ResponseParams.error
err = messageValidator.validateEnum(offset + codec.kStructHeaderSize + 0, UsbOpenDeviceError);
if (err !== validator.validationError.NONE)
@@ -1814,7 +1794,6 @@
return err;
-
// validate UsbDevice_ControlTransferIn_Params.params
err = messageValidator.validateStructPointer(offset + codec.kStructHeaderSize + 0, UsbControlTransferParams, false);
if (err !== validator.validationError.NONE)
@@ -1877,16 +1856,14 @@
return err;
-
// validate UsbDevice_ControlTransferIn_ResponseParams.status
err = messageValidator.validateEnum(offset + codec.kStructHeaderSize + 0, UsbTransferStatus);
if (err !== validator.validationError.NONE)
return err;
-
// validate UsbDevice_ControlTransferIn_ResponseParams.data
- err = messageValidator.validateArrayPointer(offset + codec.kStructHeaderSize + 8, 1, codec.Uint8, true, [0], 0);
+ err = messageValidator.validateArrayPointer(offset + codec.kStructHeaderSize + 8, 1, codec.Uint8, false, [0], 0);
if (err !== validator.validationError.NONE)
return err;
@@ -1952,14 +1929,12 @@
return err;
-
// validate UsbDevice_ControlTransferOut_Params.params
err = messageValidator.validateStructPointer(offset + codec.kStructHeaderSize + 0, UsbControlTransferParams, false);
if (err !== validator.validationError.NONE)
return err;
-
// validate UsbDevice_ControlTransferOut_Params.data
err = messageValidator.validateArrayPointer(offset + codec.kStructHeaderSize + 8, 1, codec.Uint8, false, [0], 0);
if (err !== validator.validationError.NONE)
@@ -2028,7 +2003,6 @@
return err;
-
// validate UsbDevice_ControlTransferOut_ResponseParams.status
err = messageValidator.validateEnum(offset + codec.kStructHeaderSize + 0, UsbTransferStatus);
if (err !== validator.validationError.NONE)
@@ -2165,16 +2139,14 @@
return err;
-
// validate UsbDevice_GenericTransferIn_ResponseParams.status
err = messageValidator.validateEnum(offset + codec.kStructHeaderSize + 0, UsbTransferStatus);
if (err !== validator.validationError.NONE)
return err;
-
// validate UsbDevice_GenericTransferIn_ResponseParams.data
- err = messageValidator.validateArrayPointer(offset + codec.kStructHeaderSize + 8, 1, codec.Uint8, true, [0], 0);
+ err = messageValidator.validateArrayPointer(offset + codec.kStructHeaderSize + 8, 1, codec.Uint8, false, [0], 0);
if (err !== validator.validationError.NONE)
return err;
@@ -2241,7 +2213,6 @@
-
// validate UsbDevice_GenericTransferOut_Params.data
err = messageValidator.validateArrayPointer(offset + codec.kStructHeaderSize + 8, 1, codec.Uint8, false, [0], 0);
if (err !== validator.validationError.NONE)
@@ -2308,7 +2279,6 @@
return err;
-
// validate UsbDevice_GenericTransferOut_ResponseParams.status
err = messageValidator.validateEnum(offset + codec.kStructHeaderSize + 0, UsbTransferStatus);
if (err !== validator.validationError.NONE)
@@ -2375,7 +2345,6 @@
-
// validate UsbDevice_IsochronousTransferIn_Params.packetLengths
err = messageValidator.validateArrayPointer(offset + codec.kStructHeaderSize + 8, 4, codec.Uint32, false, [0], 0);
if (err !== validator.validationError.NONE)
@@ -2443,14 +2412,12 @@
return err;
-
// validate UsbDevice_IsochronousTransferIn_ResponseParams.data
- err = messageValidator.validateArrayPointer(offset + codec.kStructHeaderSize + 0, 1, codec.Uint8, true, [0], 0);
+ err = messageValidator.validateArrayPointer(offset + codec.kStructHeaderSize + 0, 1, codec.Uint8, false, [0], 0);
if (err !== validator.validationError.NONE)
return err;
-
// validate UsbDevice_IsochronousTransferIn_ResponseParams.packets
err = messageValidator.validateArrayPointer(offset + codec.kStructHeaderSize + 8, 8, new codec.PointerTo(UsbIsochronousPacket), false, [0], 0);
if (err !== validator.validationError.NONE)
@@ -2512,14 +2479,12 @@
-
// validate UsbDevice_IsochronousTransferOut_Params.data
err = messageValidator.validateArrayPointer(offset + codec.kStructHeaderSize + 8, 1, codec.Uint8, false, [0], 0);
if (err !== validator.validationError.NONE)
return err;
-
// validate UsbDevice_IsochronousTransferOut_Params.packetLengths
err = messageValidator.validateArrayPointer(offset + codec.kStructHeaderSize + 16, 4, codec.Uint32, false, [0], 0);
if (err !== validator.validationError.NONE)
@@ -2588,7 +2553,6 @@
return err;
-
// validate UsbDevice_IsochronousTransferOut_ResponseParams.packets
err = messageValidator.validateArrayPointer(offset + codec.kStructHeaderSize + 0, 8, new codec.PointerTo(UsbIsochronousPacket), false, [0], 0);
if (err !== validator.validationError.NONE)
diff --git a/resources/chromium/device_manager.mojom.js b/resources/chromium/device_manager.mojom.js
index 99ebd85..f490b65 100644
--- a/resources/chromium/device_manager.mojom.js
+++ b/resources/chromium/device_manager.mojom.js
@@ -2,19 +2,15 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-
'use strict';
(function() {
- var mojomId = 'device/usb/public/interfaces/device_manager.mojom';
+ var mojomId = 'device/usb/public/mojom/device_manager.mojom';
if (mojo.internal.isMojomLoaded(mojomId)) {
console.warn('The following mojom is loaded multiple times: ' + mojomId);
return;
}
mojo.internal.markMojomLoaded(mojomId);
-
- // TODO(yzshen): Define these aliases to minimize the differences between the
- // old/new modes. Remove them when the old mode goes away.
var bindings = mojo;
var associatedBindings = mojo;
var codec = mojo.internal;
@@ -25,7 +21,7 @@
mojo.internal.exposeNamespace('device.mojom');
if (mojo.config.autoLoadMojomDeps) {
mojo.internal.loadMojomIfNecessary(
- 'device/usb/public/interfaces/device.mojom', 'device.mojom.js');
+ 'device/usb/public/mojom/device.mojom', 'device.mojom.js');
}
var string16$ =
mojo.internal.exposeNamespace('mojo.common.mojom');
@@ -86,7 +82,6 @@
-
// validate UsbDeviceFilter.serialNumber
err = messageValidator.validateStructPointer(offset + codec.kStructHeaderSize + 8, string16$.String16, true);
if (err !== validator.validationError.NONE)
@@ -165,7 +160,6 @@
return err;
-
// validate UsbEnumerationOptions.filters
err = messageValidator.validateArrayPointer(offset + codec.kStructHeaderSize + 0, 8, new codec.PointerTo(UsbDeviceFilter), false, [0], 0);
if (err !== validator.validationError.NONE)
@@ -221,7 +215,6 @@
return err;
-
// validate UsbDeviceManager_GetDevices_Params.options
err = messageValidator.validateStructPointer(offset + codec.kStructHeaderSize + 0, UsbEnumerationOptions, true);
if (err !== validator.validationError.NONE)
@@ -277,7 +270,6 @@
return err;
-
// validate UsbDeviceManager_GetDevices_ResponseParams.results
err = messageValidator.validateArrayPointer(offset + codec.kStructHeaderSize + 0, 8, new codec.PointerTo(device$.UsbDeviceInfo), false, [0], 0);
if (err !== validator.validationError.NONE)
@@ -334,14 +326,12 @@
return err;
-
// validate UsbDeviceManager_GetDevice_Params.guid
err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 0, false)
if (err !== validator.validationError.NONE)
return err;
-
// validate UsbDeviceManager_GetDevice_Params.deviceRequest
err = messageValidator.validateInterfaceRequest(offset + codec.kStructHeaderSize + 8, false)
if (err !== validator.validationError.NONE)
@@ -407,7 +397,6 @@
return err;
-
// validate UsbDeviceManager_SetClient_Params.client
err = messageValidator.validateInterface(offset + codec.kStructHeaderSize + 0, false);
if (err !== validator.validationError.NONE)
@@ -463,7 +452,6 @@
return err;
-
// validate UsbDeviceManagerClient_OnDeviceAdded_Params.deviceInfo
err = messageValidator.validateStructPointer(offset + codec.kStructHeaderSize + 0, device$.UsbDeviceInfo, false);
if (err !== validator.validationError.NONE)
@@ -519,7 +507,6 @@
return err;
-
// validate UsbDeviceManagerClient_OnDeviceRemoved_Params.deviceInfo
err = messageValidator.validateStructPointer(offset + codec.kStructHeaderSize + 0, device$.UsbDeviceInfo, false);
if (err !== validator.validationError.NONE)
diff --git a/resources/chromium/fake_bluetooth.mojom.js b/resources/chromium/fake_bluetooth.mojom.js
index dd2d653..7028fcb 100644
--- a/resources/chromium/fake_bluetooth.mojom.js
+++ b/resources/chromium/fake_bluetooth.mojom.js
@@ -5,7 +5,7 @@
'use strict';
(function() {
- var mojomId = 'device/bluetooth/public/interfaces/test/fake_bluetooth.mojom';
+ var mojomId = 'device/bluetooth/public/mojom/test/fake_bluetooth.mojom';
if (mojo.internal.isMojomLoaded(mojomId)) {
console.warn('The following mojom is loaded multiple times: ' + mojomId);
return;
@@ -21,7 +21,7 @@
mojo.internal.exposeNamespace('bluetooth.mojom');
if (mojo.config.autoLoadMojomDeps) {
mojo.internal.loadMojomIfNecessary(
- 'device/bluetooth/public/interfaces/uuid.mojom', '../uuid.mojom.js');
+ 'device/bluetooth/public/mojom/uuid.mojom', '../uuid.mojom.js');
}
@@ -1256,7 +1256,7 @@
FakeCentral_RemoveFakeService_Params.prototype.initDefaults_ = function() {
- this.identifier = null;
+ this.serviceId = null;
this.peripheralAddress = null;
};
FakeCentral_RemoveFakeService_Params.prototype.initFields_ = function(fields) {
@@ -1280,7 +1280,7 @@
return err;
- // validate FakeCentral_RemoveFakeService_Params.identifier
+ // validate FakeCentral_RemoveFakeService_Params.serviceId
err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 0, false)
if (err !== validator.validationError.NONE)
return err;
@@ -1301,7 +1301,7 @@
var val = new FakeCentral_RemoveFakeService_Params();
var numberOfBytes = decoder.readUint32();
var version = decoder.readUint32();
- val.identifier = decoder.decodeStruct(codec.String);
+ val.serviceId = decoder.decodeStruct(codec.String);
val.peripheralAddress = decoder.decodeStruct(codec.String);
return val;
};
@@ -1310,7 +1310,7 @@
var packed;
encoder.writeUint32(FakeCentral_RemoveFakeService_Params.encodedSize);
encoder.writeUint32(0);
- encoder.encodeStruct(codec.String, val.identifier);
+ encoder.encodeStruct(codec.String, val.serviceId);
encoder.encodeStruct(codec.String, val.peripheralAddress);
};
function FakeCentral_RemoveFakeService_ResponseParams(values) {
@@ -3017,9 +3017,9 @@
.apply(this.ptr.getProxy(), arguments);
};
- FakeCentralProxy.prototype.removeFakeService = function(identifier, peripheralAddress) {
+ FakeCentralProxy.prototype.removeFakeService = function(serviceId, peripheralAddress) {
var params = new FakeCentral_RemoveFakeService_Params();
- params.identifier = identifier;
+ params.serviceId = serviceId;
params.peripheralAddress = peripheralAddress;
return new Promise(function(resolve, reject) {
var builder = new codec.MessageV1Builder(
@@ -3285,8 +3285,8 @@
FakeCentralStub.prototype.addFakeService = function(peripheralAddress, serviceUuid) {
return this.delegate_ && this.delegate_.addFakeService && this.delegate_.addFakeService(peripheralAddress, serviceUuid);
}
- FakeCentralStub.prototype.removeFakeService = function(identifier, peripheralAddress) {
- return this.delegate_ && this.delegate_.removeFakeService && this.delegate_.removeFakeService(identifier, peripheralAddress);
+ FakeCentralStub.prototype.removeFakeService = function(serviceId, peripheralAddress) {
+ return this.delegate_ && this.delegate_.removeFakeService && this.delegate_.removeFakeService(serviceId, peripheralAddress);
}
FakeCentralStub.prototype.addFakeCharacteristic = function(characteristicUuid, properties, serviceId, peripheralAddress) {
return this.delegate_ && this.delegate_.addFakeCharacteristic && this.delegate_.addFakeCharacteristic(characteristicUuid, properties, serviceId, peripheralAddress);
@@ -3422,7 +3422,7 @@
return true;
case kFakeCentral_RemoveFakeService_Name:
var params = reader.decodeStruct(FakeCentral_RemoveFakeService_Params);
- this.removeFakeService(params.identifier, params.peripheralAddress).then(function(response) {
+ this.removeFakeService(params.serviceId, params.peripheralAddress).then(function(response) {
var responseParams =
new FakeCentral_RemoveFakeService_ResponseParams();
responseParams.success = response.success;
diff --git a/resources/chromium/uuid.mojom.js b/resources/chromium/uuid.mojom.js
index 03a8b8d..3b1b616 100644
--- a/resources/chromium/uuid.mojom.js
+++ b/resources/chromium/uuid.mojom.js
@@ -5,15 +5,12 @@
'use strict';
(function() {
- var mojomId = 'device/bluetooth/public/interfaces/uuid.mojom';
+ var mojomId = 'device/bluetooth/public/mojom/uuid.mojom';
if (mojo.internal.isMojomLoaded(mojomId)) {
console.warn('The following mojom is loaded multiple times: ' + mojomId);
return;
}
mojo.internal.markMojomLoaded(mojomId);
-
- // TODO(yzshen): Define these aliases to minimize the differences between the
- // old/new modes. Remove them when the old mode goes away.
var bindings = mojo;
var associatedBindings = mojo;
var codec = mojo.internal;
diff --git a/service-workers/service-worker/fetch-event-respond-with-body-loaded-in-chunk.https.html b/service-workers/service-worker/fetch-event-respond-with-body-loaded-in-chunk.https.html
new file mode 100644
index 0000000..824b6f3
--- /dev/null
+++ b/service-workers/service-worker/fetch-event-respond-with-body-loaded-in-chunk.https.html
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>respondWith with a response whose body is being loaded from the network by chunks</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="resources/test-helpers.sub.js"></script>
+<script>
+'use strict';
+
+const WORKER = 'resources/fetch-event-respond-with-body-loaded-in-chunk-worker.js';
+const SCOPE = 'resources/fetch-event-respond-with-body-loaded-in-chunk-iframe.html';
+
+promise_test(async t => {
+ var reg = await service_worker_unregister_and_register(t, WORKER, SCOPE);
+ add_completion_callback(() => reg.unregister());
+ await wait_for_state(t, reg.installing, 'activated');
+ let iframe = await with_iframe(SCOPE);
+ t.add_cleanup(() => iframe.remove());
+
+ let response = await iframe.contentWindow.fetch('body-in-chunk');
+ assert_equals(await response.text(), 'TEST_TRICKLE\nTEST_TRICKLE\nTEST_TRICKLE\nTEST_TRICKLE\n');
+}, 'Respond by chunks with a Response being loaded');
+</script>
diff --git a/service-workers/service-worker/resources/fetch-event-respond-with-body-loaded-in-chunk-worker.js b/service-workers/service-worker/resources/fetch-event-respond-with-body-loaded-in-chunk-worker.js
new file mode 100644
index 0000000..d3ba8a8
--- /dev/null
+++ b/service-workers/service-worker/resources/fetch-event-respond-with-body-loaded-in-chunk-worker.js
@@ -0,0 +1,7 @@
+'use strict';
+
+self.addEventListener('fetch', event => {
+ if (!event.request.url.match(/body-in-chunk$/))
+ return;
+ event.respondWith(fetch("../../../fetch/api/resources/trickle.py?count=4&delay=50"));
+});