mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Update web-platform-tests to revision b'099ab08227717e000b444ff560e93f96b49e05d7'
This commit is contained in:
parent
53570ffe55
commit
a1db4c746d
172 changed files with 12261 additions and 2279 deletions
|
@ -10,10 +10,11 @@
|
|||
var ENCODER_CONFIG = null;
|
||||
promise_setup(async () => {
|
||||
const config = {
|
||||
'?av1': {codec: 'av01.0.04M.08'},
|
||||
'?vp8': {codec: 'vp8'},
|
||||
'?vp9_p0': {codec: 'vp09.00.10.08'},
|
||||
'?vp9_p2': {codec: 'vp09.02.10.10'},
|
||||
// FIXME: H.264 has embedded color space information too.
|
||||
'?av1': {codec: 'av01.0.04M.08', hasEmbeddedColorSpace: true},
|
||||
'?vp8': {codec: 'vp8', hasEmbeddedColorSpace: false},
|
||||
'?vp9_p0': {codec: 'vp09.00.10.08', hasEmbeddedColorSpace: true},
|
||||
'?vp9_p2': {codec: 'vp09.02.10.10', hasEmbeddedColorSpace: true},
|
||||
'?h264_avc': {codec: 'avc1.42001E', avc: {format: 'avc'}},
|
||||
'?h264_annexb': {codec: 'avc1.42001E', avc: {format: 'annexb'}}
|
||||
}[location.search];
|
||||
|
@ -26,7 +27,7 @@ promise_setup(async () => {
|
|||
ENCODER_CONFIG = config;
|
||||
});
|
||||
|
||||
promise_test(async t => {
|
||||
async function runFullCycleTest(t, options) {
|
||||
let encoder_config = { ...ENCODER_CONFIG };
|
||||
const w = encoder_config.width;
|
||||
const h = encoder_config.height;
|
||||
|
@ -41,6 +42,17 @@ promise_test(async t => {
|
|||
assert_equals(frame.visibleRect.width, w, "visibleRect.width");
|
||||
assert_equals(frame.visibleRect.height, h, "visibleRect.height");
|
||||
assert_equals(frame.timestamp, next_ts++, "decode timestamp");
|
||||
|
||||
// The encoder is allowed to change the color space to satisfy the
|
||||
// encoder when readback is needed to send the frame for encoding, so
|
||||
// just ensure we have something set on the frame.
|
||||
assert_not_equals(
|
||||
frame.colorSpace.primaries, null, 'colorSpace.primaries');
|
||||
assert_not_equals(frame.colorSpace.transfer, null, 'colorSpace.transfer');
|
||||
assert_not_equals(frame.colorSpace.matrix, null, 'colorSpace.matrix');
|
||||
assert_not_equals(
|
||||
frame.colorSpace.fullRange, null, 'colorSpace.fullRange');
|
||||
|
||||
frames_decoded++;
|
||||
assert_true(validateBlackDots(frame, frame.timestamp),
|
||||
"frame doesn't match. ts: " + frame.timestamp);
|
||||
|
@ -57,6 +69,12 @@ promise_test(async t => {
|
|||
let config = metadata.decoderConfig;
|
||||
if (config) {
|
||||
config.hardwareAcceleration = encoder_config.hardwareAcceleration;
|
||||
|
||||
// Removes the color space provided by the encoder so that color space
|
||||
// information in the underlying bitstream is exposed during decode.
|
||||
if (options.stripDecoderConfigColorSpace)
|
||||
config.colorSpace = {};
|
||||
|
||||
decoder.configure(config);
|
||||
}
|
||||
decoder.decode(chunk);
|
||||
|
@ -73,6 +91,13 @@ promise_test(async t => {
|
|||
|
||||
for (let i = 0; i < frames_to_encode; i++) {
|
||||
let frame = createDottedFrame(w, h, i);
|
||||
|
||||
// Frames should have a valid color space when created from canvas.
|
||||
assert_not_equals(frame.colorSpace.primaries, null, 'colorSpace.primaries');
|
||||
assert_not_equals(frame.colorSpace.transfer, null, 'colorSpace.transfer');
|
||||
assert_not_equals(frame.colorSpace.matrix, null, 'colorSpace.matrix');
|
||||
assert_not_equals(frame.colorSpace.fullRange, null, 'colorSpace.fullRange');
|
||||
|
||||
let keyframe = (i % 5 == 0);
|
||||
encoder.encode(frame, { keyFrame: keyframe });
|
||||
frame.close();
|
||||
|
@ -83,5 +108,13 @@ promise_test(async t => {
|
|||
decoder.close();
|
||||
assert_equals(frames_encoded, frames_to_encode, "frames_encoded");
|
||||
assert_equals(frames_decoded, frames_to_encode, "frames_decoded");
|
||||
}
|
||||
|
||||
promise_test(async t => {
|
||||
return runFullCycleTest(t, {});
|
||||
}, 'Encoding and decoding cycle');
|
||||
|
||||
promise_test(async t => {
|
||||
if (ENCODER_CONFIG.hasEmbeddedColorSpace)
|
||||
return runFullCycleTest(t, {stripDecoderConfigColorSpace: true});
|
||||
}, 'Encoding and decoding cycle w/ stripped color space');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue