Update web-platform-tests to revision b'b728032f59a396243864b0f8584e7211e3632005'

This commit is contained in:
WPT Sync Bot 2022-11-10 01:22:36 +00:00
parent ace9b32b1c
commit df68c4e5d1
15632 changed files with 514865 additions and 155000 deletions

View file

@ -67,9 +67,18 @@ function validateBlackDots(frame, count) {
let x = i * step + dot_size / 2;
let y = step * (x / width + 1) + dot_size / 2;
x %= width;
let rgba = ctx.getImageData(x, y, 1, 1).data;
if (x)
x = x -1;
if (y)
y = y -1;
let rgba = ctx.getImageData(x, y, 2, 2).data;
const tolerance = 40;
if (rgba[0] > tolerance || rgba[1] > tolerance || rgba[2] > tolerance) {
if ((rgba[0] > tolerance || rgba[1] > tolerance || rgba[2] > tolerance)
&& (rgba[4] > tolerance || rgba[5] > tolerance || rgba[6] > tolerance)
&& (rgba[8] > tolerance || rgba[9] > tolerance || rgba[10] > tolerance)
&& (rgba[12] > tolerance || rgba[13] > tolerance || rgba[14] > tolerance)) {
// The dot is too bright to be a black dot.
return false;
}
@ -78,20 +87,22 @@ function validateBlackDots(frame, count) {
}
function createFrame(width, height, ts = 0) {
let duration = 33333; // 30fps
let text = ts.toString();
let cnv = new OffscreenCanvas(width, height);
var ctx = cnv.getContext('2d');
fourColorsFrame(ctx, width, height, text);
return new VideoFrame(cnv, { timestamp: ts });
return new VideoFrame(cnv, { timestamp: ts, duration });
}
function createDottedFrame(width, height, dots, ts) {
if (ts === undefined)
ts = dots;
let duration = 33333; // 30fps
let text = ts.toString();
let cnv = new OffscreenCanvas(width, height);
var ctx = cnv.getContext('2d');
fourColorsFrame(ctx, width, height, text);
putBlackDots(ctx, width, height, dots);
return new VideoFrame(cnv, { timestamp: ts });
}
return new VideoFrame(cnv, { timestamp: ts, duration });
}