Update web-platform-tests to revision 0313d9f383d954ef401e79f3b669a5781aa3441a

This commit is contained in:
WPT Sync Bot 2018-09-02 21:39:17 -04:00
parent aa61200eca
commit b28a41ac85
55 changed files with 970 additions and 156 deletions

View file

@ -173,6 +173,7 @@
this.contrast = null;
this.saturation = null;
this.sharpness = null;
this.focusDistance = null;
this.zoom = null;
this.redEyeReduction = 0;
this.height = null;
@ -193,7 +194,7 @@
return err;
var kVersionSizes = [
{version: 0, numBytes: 152}
{version: 0, numBytes: 160}
];
err = messageValidator.validateStructVersion(offset, kVersionSizes);
if (err !== validator.validationError.NONE)
@ -284,41 +285,47 @@
return err;
// validate PhotoState.zoom
// validate PhotoState.focusDistance
err = messageValidator.validateStructPointer(offset + codec.kStructHeaderSize + 104, Range, false);
if (err !== validator.validationError.NONE)
return err;
// validate PhotoState.zoom
err = messageValidator.validateStructPointer(offset + codec.kStructHeaderSize + 112, Range, false);
if (err !== validator.validationError.NONE)
return err;
// validate PhotoState.redEyeReduction
err = messageValidator.validateEnum(offset + codec.kStructHeaderSize + 112, RedEyeReduction);
err = messageValidator.validateEnum(offset + codec.kStructHeaderSize + 120, RedEyeReduction);
if (err !== validator.validationError.NONE)
return err;
// validate PhotoState.height
err = messageValidator.validateStructPointer(offset + codec.kStructHeaderSize + 120, Range, false);
if (err !== validator.validationError.NONE)
return err;
// validate PhotoState.width
err = messageValidator.validateStructPointer(offset + codec.kStructHeaderSize + 128, Range, false);
if (err !== validator.validationError.NONE)
return err;
// validate PhotoState.width
err = messageValidator.validateStructPointer(offset + codec.kStructHeaderSize + 136, Range, false);
if (err !== validator.validationError.NONE)
return err;
// validate PhotoState.fillLightMode
err = messageValidator.validateArrayPointer(offset + codec.kStructHeaderSize + 136, 4, new codec.Enum(FillLightMode), false, [0], 0);
err = messageValidator.validateArrayPointer(offset + codec.kStructHeaderSize + 144, 4, new codec.Enum(FillLightMode), false, [0], 0);
if (err !== validator.validationError.NONE)
return err;
return validator.validationError.NONE;
};
PhotoState.encodedSize = codec.kStructHeaderSize + 144;
PhotoState.encodedSize = codec.kStructHeaderSize + 152;
PhotoState.decode = function(decoder) {
var packed;
@ -345,6 +352,7 @@
val.contrast = decoder.decodeStructPointer(Range);
val.saturation = decoder.decodeStructPointer(Range);
val.sharpness = decoder.decodeStructPointer(Range);
val.focusDistance = decoder.decodeStructPointer(Range);
val.zoom = decoder.decodeStructPointer(Range);
val.redEyeReduction = decoder.decodeStruct(codec.Int32);
decoder.skip(1);
@ -382,6 +390,7 @@
encoder.encodeStructPointer(Range, val.contrast);
encoder.encodeStructPointer(Range, val.saturation);
encoder.encodeStructPointer(Range, val.sharpness);
encoder.encodeStructPointer(Range, val.focusDistance);
encoder.encodeStructPointer(Range, val.zoom);
encoder.encodeStruct(codec.Int32, val.redEyeReduction);
encoder.skip(1);
@ -463,6 +472,7 @@
this.hasContrast = false;
this.hasSaturation = false;
this.hasSharpness = false;
this.hasFocusDistance = false;
this.hasZoom = false;
this.hasTorch = false;
this.torch = false;
@ -482,6 +492,7 @@
this.contrast = 0;
this.saturation = 0;
this.sharpness = 0;
this.focusDistance = 0;
this.zoom = 0;
this.fillLightMode = 0;
this.width = 0;
@ -501,7 +512,7 @@
return err;
var kVersionSizes = [
{version: 0, numBytes: 120}
{version: 0, numBytes: 128}
];
err = messageValidator.validateStructVersion(offset, kVersionSizes);
if (err !== validator.validationError.NONE)
@ -551,11 +562,13 @@
// validate PhotoSettings.fillLightMode
err = messageValidator.validateEnum(offset + codec.kStructHeaderSize + 88, FillLightMode);
err = messageValidator.validateEnum(offset + codec.kStructHeaderSize + 96, FillLightMode);
if (err !== validator.validationError.NONE)
return err;
@ -568,7 +581,7 @@
return validator.validationError.NONE;
};
PhotoSettings.encodedSize = codec.kStructHeaderSize + 112;
PhotoSettings.encodedSize = codec.kStructHeaderSize + 120;
PhotoSettings.decode = function(decoder) {
var packed;
@ -587,15 +600,16 @@
packed = decoder.readUint8();
val.hasSaturation = (packed >> 0) & 1 ? true : false;
val.hasSharpness = (packed >> 1) & 1 ? true : false;
val.hasZoom = (packed >> 2) & 1 ? true : false;
val.hasTorch = (packed >> 3) & 1 ? true : false;
val.torch = (packed >> 4) & 1 ? true : false;
val.hasFillLightMode = (packed >> 5) & 1 ? true : false;
val.hasWidth = (packed >> 6) & 1 ? true : false;
val.hasHeight = (packed >> 7) & 1 ? true : false;
val.hasFocusDistance = (packed >> 2) & 1 ? true : false;
val.hasZoom = (packed >> 3) & 1 ? true : false;
val.hasTorch = (packed >> 4) & 1 ? true : false;
val.torch = (packed >> 5) & 1 ? true : false;
val.hasFillLightMode = (packed >> 6) & 1 ? true : false;
val.hasWidth = (packed >> 7) & 1 ? true : false;
packed = decoder.readUint8();
val.hasRedEyeReduction = (packed >> 0) & 1 ? true : false;
val.redEyeReduction = (packed >> 1) & 1 ? true : false;
val.hasHeight = (packed >> 0) & 1 ? true : false;
val.hasRedEyeReduction = (packed >> 1) & 1 ? true : false;
val.redEyeReduction = (packed >> 2) & 1 ? true : false;
decoder.skip(1);
val.whiteBalanceMode = decoder.decodeStruct(codec.Int32);
val.exposureMode = decoder.decodeStruct(codec.Int32);
@ -608,6 +622,7 @@
val.contrast = decoder.decodeStruct(codec.Double);
val.saturation = decoder.decodeStruct(codec.Double);
val.sharpness = decoder.decodeStruct(codec.Double);
val.focusDistance = decoder.decodeStruct(codec.Double);
val.zoom = decoder.decodeStruct(codec.Double);
val.fillLightMode = decoder.decodeStruct(codec.Int32);
decoder.skip(1);
@ -636,16 +651,17 @@
packed = 0;
packed |= (val.hasSaturation & 1) << 0
packed |= (val.hasSharpness & 1) << 1
packed |= (val.hasZoom & 1) << 2
packed |= (val.hasTorch & 1) << 3
packed |= (val.torch & 1) << 4
packed |= (val.hasFillLightMode & 1) << 5
packed |= (val.hasWidth & 1) << 6
packed |= (val.hasHeight & 1) << 7
packed |= (val.hasFocusDistance & 1) << 2
packed |= (val.hasZoom & 1) << 3
packed |= (val.hasTorch & 1) << 4
packed |= (val.torch & 1) << 5
packed |= (val.hasFillLightMode & 1) << 6
packed |= (val.hasWidth & 1) << 7
encoder.writeUint8(packed);
packed = 0;
packed |= (val.hasRedEyeReduction & 1) << 0
packed |= (val.redEyeReduction & 1) << 1
packed |= (val.hasHeight & 1) << 0
packed |= (val.hasRedEyeReduction & 1) << 1
packed |= (val.redEyeReduction & 1) << 2
encoder.writeUint8(packed);
encoder.skip(1);
encoder.encodeStruct(codec.Int32, val.whiteBalanceMode);
@ -659,6 +675,7 @@
encoder.encodeStruct(codec.Double, val.contrast);
encoder.encodeStruct(codec.Double, val.saturation);
encoder.encodeStruct(codec.Double, val.sharpness);
encoder.encodeStruct(codec.Double, val.focusDistance);
encoder.encodeStruct(codec.Double, val.zoom);
encoder.encodeStruct(codec.Int32, val.fillLightMode);
encoder.skip(1);

View file

@ -77,6 +77,13 @@ var ImageCaptureTest = (() => {
step: 1.0
},
focusDistance: {
min: 1.0,
max: 10.0,
current: 3.0,
step: 1.0
},
zoom: {
min: 0.0,
max: 10.0,
@ -130,6 +137,8 @@ var ImageCaptureTest = (() => {
this.state_.state.zoom.current = settings.zoom;
if (settings.hasFocusMode)
this.state_.state.currentFocusMode = settings.focusMode;
if (settings.hasFocusDistance)
this.state_.state.focusDistance.current = settings.focusDistance;
if (settings.pointsOfInterest.length > 0) {
this.state_.state.pointsOfInterest =